AngularJS Flashcards

1
Q

Ahead-of-time (AOT) compilation

A

You can compile Angular applications at build time. By compiling your application using the compiler-cli, ngc, you can bootstrap directly to a module factory, meaning you don’t need to include the Angular compiler in your JavaScript bundle. Ahead-of-time compiled applications also benefit from decreased load time and increased performance.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Annotation

A

In practice, a synonym for Decoration.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Attribute directives

A

A category of directive that can listen to and modify the behavior of other HTML elements, attributes, properties, and components. They are usually represented as HTML attributes, hence the name.

For example, you can use the ngClass directive to add and remove CSS class names.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Barrel

A

A way to roll up exports from several ES2015 modules into a single convenient ES2015 module. The barrel itself is an ES2015 module file that re-exports selected exports of other ES2015 modules.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Binding

A

Usually refers to data binding and the act of binding an HTML object property to a data object property.

Sometimes refers to a dependency-injection binding between a “token”—also referred to as a “key”—and a dependency provider.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Bootstrap

A

You launch an Angular application by “bootstrapping” it using the application root NgModule (AppModule).

Bootstrapping identifies an application’s top level “root” component, which is the first component that is loaded for the application. For more information, see the Setup page.

You can bootstrap multiple apps in the same index.html, each app with its own top-level root.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

camelCase

A

The practice of writing compound words or phrases such that each word or abbreviation begins with a capital letter except the first letter, which is lowercase.

Function, property, and method names are typically spelled in camelCase.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Component

A

An Angular class responsible for exposing data to a view and handling most of the view’s display and user-interaction logic.

The component is one of the most important building blocks in the Angular system. It is, in fact, an Angular directive with a companion template.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

dash-case

A

The practice of writing compound words or phrases such that each word is separated by a dash or hyphen (-). This form is also known as kebab-case.

Directive selectors (like my-app) and the root of filenames (such as hero-list.component.ts) are often spelled in dash-case.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Data binding

A

Applications display data values to a user and respond to user actions (such as clicks, touches, and keystrokes).

In data binding, you declare the relationship between an HTML widget and data source and let the framework handle the details. Data binding is an alternative to manually pushing application data values into HTML, attaching event listeners, pulling changed values from the screen, and updating application data values.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Decorator | decoration

A

A function that adds metadata to a class, its members (properties, methods) and function arguments.

Decorators are an experimental (stage 2), JavaScript language feature. TypeScript adds support for decorators.

To apply a decorator, position it immediately above or to the left of the item it decorates.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Dependency injection

A

A design pattern and mechanism for creating and delivering parts of an application to other parts of an application that request them.

Angular developers prefer to build applications by defining many simple parts that each do one thing well and then wiring them together at runtime.

These parts often rely on other parts. An Angular component part might rely on a service part to get data or perform a calculation. When part “A” relies on another part “B,” you say that “A” depends on “B” and that “B” is a dependency of “A.”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Directive

A

An Angular class responsible for creating, reshaping, and interacting with HTML elements in the browser DOM. The directive is Angular’s most fundamental feature.

A directive is usually associated with an HTML element or attribute. This element or attribute is often referred to as the directive itself.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

ECMAScript

A

The latest approved version of JavaScript is ECMAScript 2017 (also known as “ES2017” or “ES8”). Many Angular developers write their applications in ES8 or a dialect that strives to be compatible with it, such as TypeScript.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Injector

A

An object in the Angular dependency-injection system that can find a named dependency in its cache or create a dependency with a registered provider.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Input

A

A directive property that can be the target of a property binding (explained in detail in the Template Syntax page). Data values flow into this property from the data source identified in the template expression to the right of the equal sign.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Interpolation

A

A form of property data binding in which a template expression between double-curly braces renders as text. That text may be concatenated with neighboring text before it is assigned to an element property or displayed between element tags

18
Q

Just-in-time (JIT) compilation

A

A bootstrapping method of compiling components and modules in the browser and launching the application dynamically. Just-in-time mode is a good choice during development. Consider using the ahead-of-time mode for production apps.

19
Q

Lifecycle hooks

A

Directives and components have a lifecycle managed by Angular as it creates, updates, and destroys them.

You can tap into key moments in that lifecycle by implementing one or more of the lifecycle hook interfaces.

Each interface has a single hook method whose name is the interface name prefixed with ng.

20
Q

Module

A

A cohesive block of code dedicated to a single purpose.

Angular apps are modular.

In general, you assemble an application from many modules, both the ones you write and the ones you acquire from others.

A module exports something of value in that code, typically one thing such as a class; a module that needs that class imports it.

21
Q

NgModule

A

Helps you organize an application into cohesive blocks of functionality. An NgModule identifies the components, directives, and pipes that the application uses along with the list of external NgModules that the application needs, such as FormsModule.

Every Angular application has an application root-module class. By convention, the class is called AppModule and resides in a file named app.module.ts.

22
Q

Observable

A

An array whose items arrive asynchronously over time. Observables help you manage asynchronous data, such as data coming from a backend service. Observables are used within Angular itself, including Angular’s event system and its HTTP client service.

23
Q

Output

A

A directive property that can be the target of event binding (read more in the event binding section of the Template Syntax page). Events stream out of this property to the receiver identified in the template expression to the right of the equal sign.

24
Q

PascalCase

A

The practice of writing individual words, compound words, or phrases such that each word or abbreviation begins with a capital letter. Class names are typically spelled in PascalCase. For example, Person and HeroDetailComponent.

25
Q

Pipe

A

An Angular pipe is a function that transforms input values to output values for display in a view.

26
Q

Provider

A

A provider creates a new instance of a dependency for the dependency injection system. It relates a lookup token to code—sometimes called a “recipe”—that can create a dependency value.

27
Q

Reactive forms

A

A technique for building Angular forms through code in a component. The alternative technique is template-driven forms.

28
Q

Router

A

Most applications consist of many screens or views. The user navigates among them by clicking links and buttons, and performing other similar actions that cause the application to replace one view with another.

The Angular component router is a richly featured mechanism for configuring and managing the entire view navigation process, including the creation and destruction of views.

In most cases, components become attached to a router by means of a RouterConfig that defines routes to views.

29
Q

Router module

A

A separate NgModule that provides the necessary service providers and directives for navigating through application views.

30
Q

Routing component

A

An Angular component with a RouterOutlet that displays views based on router navigations.

31
Q

Scoped package

A

A way to group related npm packages.

32
Q

Service

A

For data or logic that is not associated with a specific view or that you want to share across components, build services.

Applications often require services such as a hero data service or a logging service.

A service is a class with a focused purpose. You often create a service to implement features that are independent from any specific view, provide shared data or logic across components, or encapsulate external interactions.

33
Q

snake_case

A

The practice of writing compound words or phrases such that an underscore (_) separates one word from the next. This form is also known as underscore case.

34
Q

Structural directives

A

A category of directive that can shape or reshape HTML layout, typically by adding and removing elements in the DOM. The ngIf “conditional element” directive and the ngFor “repeater” directive are well-known examples.

35
Q

Template

A

A chunk of HTML that Angular uses to render a view with the support and guidance of an Angular directive, most notably a component.

36
Q

Template-driven forms

A

A technique for building Angular forms using HTML forms and input elements in the view. The alternate technique is Reactive Forms.

37
Q

Template expression

A

A TypeScript-like syntax that Angular evaluates within a data binding.

38
Q

Transpile

A

The process of transforming code written in one form of JavaScript (such as TypeScript) into another form of JavaScript (such as ES5).

39
Q

TypeScript

A

A version of JavaScript that supports most ECMAScript 2015 language features such as decorators.

TypeScript is also notable for its optional typing system, which provides compile-time type checking and strong tooling support (such as “intellisense,” code completion, refactoring, and intelligent search). Many code editors and IDEs support TypeScript either natively or with plugins.

TypeScript is the preferred language for Angular development, although you can use other JavaScript dialects such as ES5.

40
Q

View

A

A portion of the screen that displays information and responds to user actions such as clicks, mouse moves, and keystrokes.

Angular renders a view under the control of one or more directives, especially component directives and their companion templates. The component plays such a prominent role that it’s often convenient to refer to a component as a view.

41
Q

Zone

A

A mechanism for encapsulating and intercepting a JavaScript application’s asynchronous activity.