You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: aio/content/guide/aot-compiler.md
+4-4
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ The Angular Ahead-of-Time (AOT) compiler converts your Angular HTML and TypeScri
4
4
5
5
This guide explains how to build with the AOT compiler using different compiler options and how to write Angular metadata that AOT can compile.
6
6
7
-
<divclass="l-sub-section">
7
+
<divclass="alertis-helpful>
8
8
9
9
<ahref="https://www.youtube.com/watch?v=kW9cJsvcsGo">Watch compiler author Tobias Bosch explain the Angular Compiler</a> at AngularConnect 2016.
10
10
@@ -39,7 +39,7 @@ For AOT compilation, append the `--aot` flags to the _build-only_ or the _build-
39
39
ng serve --aot
40
40
</code-example>
41
41
42
-
<divclass="l-sub-section">
42
+
<divclass="alert is-helpful">
43
43
44
44
The `--prod` meta-flag compiles with AOT by default.
45
45
@@ -297,7 +297,7 @@ At the same time, the AOT **_collector_** analyzes the metadata recorded in the
297
297
298
298
You can think of `.metadata.json` as a diagram of the overall structure of a decorator's metadata, represented as an [abstract syntax tree (AST)](https://en.wikipedia.org/wiki/Abstract_syntax_tree).
describes the JSON format as a collection of TypeScript interfaces.
@@ -333,7 +333,7 @@ Parentheses | `(a + b)`
333
333
If an expression uses unsupported syntax, the _collector_ writes an error node to the `.metadata.json` file. The compiler later reports the error if it needs that
334
334
piece of metadata to generate the application code.
335
335
336
-
<div class="l-sub-section">
336
+
<div class="alert is-helpful">
337
337
338
338
If you want `ngc` to report syntax errors immediately rather than produce a `.metadata.json` file with errors, set the `strictMetadataEmit` option in `tsconfig`.
The `export` of `AppComponent` is just to show how to export; it isn't actually necessary in this example. A root NgModule has no reason to _export_ anything because other modules don't need to _import_ the root NgModule.
32
32
@@ -56,7 +56,7 @@ A component and its template together define a _view_. A component can contain a
56
56
57
57
When you create a component, it is associated directly with a single view, called the _host view_. The host view can be the root of a view hierarchy, which can contain _embedded views_, which are in turn the host views of other components. Those components can be in the same NgModule, or can be imported from other NgModules. Views in the tree can be nested to any depth.
58
58
59
-
<divclass="l-sub-section">
59
+
<divclass="alert is-helpful">
60
60
The hierarchical structure of views is a key factor in the way Angular detects and responds to changes in the DOM and app data.
61
61
</div>
62
62
@@ -72,7 +72,7 @@ Other JavaScript modules use *import statements* to access public objects from o
<ahref="http://exploringjs.com/es6/ch_modules.html">Learn more about the JavaScript module system on the web.</a>
77
77
</div>
78
78
@@ -99,7 +99,7 @@ In the example of the simple root module above, the application module needs mat
99
99
100
100
In this way you're using both the Angular and JavaScript module systems _together_. Although it's easy to confuse the two systems, which share the common vocabulary of "imports" and "exports", you will become familiar with the different contexts in which they are used.
101
101
102
-
<divclass="l-sub-section">
102
+
<divclass="alert is-helpful">
103
103
104
104
Learn more from the [NgModules](guide/ngmodules) page.
Copy file name to clipboardExpand all lines: aio/content/guide/architecture.md
+6-6
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@ Like JavaScript modules, NgModules can import functionality from other NgModules
27
27
28
28
Organizing your code into distinct functional modules helps in managing development of complex applications, and in designing for reusability. In addition, this technique lets you take advantage of _lazy-loading_—that is, loading modules on demand—in order to minimize the amount of code that needs to be loaded at startup.
29
29
30
-
<divclass="l-sub-section">
30
+
<divclass="alert is-helpful">
31
31
32
32
For a more detailed discussion, see [Introduction to modules](guide/architecture-modules).
33
33
@@ -39,7 +39,7 @@ Every Angular application has at least one component, the *root component* that
39
39
40
40
The `@Component` decorator identifies the class immediately below it as a component, and provides the template and related component-specific metadata.
41
41
42
-
<divclass="l-sub-section">
42
+
<divclass="alert is-helpful">
43
43
44
44
Decorators are functions that modify JavaScript classes. Angular defines a number of such decorators that attach specific kinds of metadata to classes, so that it knows what those classes mean and how they should work.
45
45
@@ -59,7 +59,7 @@ Before a view is displayed, Angular evaluates the directives and resolves the bi
59
59
60
60
Your templates can also use *pipes* to improve the user experience by transforming values for display. Use pipes to display, for example, dates and currency values in a way appropriate to the user's locale. Angular provides predefined pipes for common transformations, and you can also define your own.
61
61
62
-
<divclass="l-sub-section">
62
+
<divclass="alert is-helpful">
63
63
64
64
For a more detailed discussion of these concepts, see [Introduction to components](guide/architecture-components).
65
65
@@ -74,7 +74,7 @@ For data or logic that is not associated with a specific view, and that you want
74
74
75
75
*Dependency injection* (or DI) lets you keep your component classes lean and efficient. They don't fetch data from the server, validate user input, or log directly to the console; they delegate such tasks to services.
76
76
77
-
<divclass="l-sub-section">
77
+
<divclass="alert is-helpful">
78
78
79
79
For a more detailed discusssion, see [Introduction to services and DI](guide/architecture-services).
80
80
@@ -96,7 +96,7 @@ The router interprets a link URL according to your app's view navigation rules a
96
96
97
97
To define navigation rules, you associate *navigation paths* with your components. A path uses a URL-like syntax that integrates your program data, in much the same way that template syntax integrates your views with your program data. You can then apply program logic to choose which views to show or to hide, in response to user input and your own access rules.
98
98
99
-
<divclass="l-sub-section">
99
+
<divclass="alert is-helpful">
100
100
101
101
For a more detailed discussion, see [Routing and navigation](guide/router).
102
102
@@ -128,7 +128,7 @@ Each of these subjects is introduced in more detail in the following pages.
128
128
*[Pipes](guide/architecture-components#pipes)
129
129
*[Services and dependency injection](guide/architecture-services)
130
130
131
-
<divclass="l-sub-section">
131
+
<divclass="alert is-helpful">
132
132
133
133
Note that the code referenced on these pages is available as a <live-example></live-example>.
Copy file name to clipboardExpand all lines: aio/content/guide/attribute-directives.md
+3-3
Original file line number
Diff line number
Diff line change
@@ -51,7 +51,7 @@ ng generate directive highlight
51
51
52
52
The CLI creates `src/app/highlight.directive.ts`, a corresponding test file (`.../spec.ts`, and _declares_ the directive class in the root `AppModule`.
53
53
54
-
<divclass="l-sub-section">
54
+
<divclass="alert is-helpful">
55
55
56
56
_Directives_ must be declared in [Angular Modules](guide/ngmodules) in the same manner as _components_.
57
57
@@ -71,7 +71,7 @@ Angular locates each element in the template that has an attribute named `appHig
71
71
72
72
The _attribute selector_ pattern explains the name of this kind of directive.
73
73
74
-
<divclass="l-sub-section">
74
+
<divclass="alert is-helpful">
75
75
76
76
#### Why not "highlight"?
77
77
@@ -146,7 +146,7 @@ each adorned by the `HostListener` decorator.
146
146
The `@HostListener` decorator lets you subscribe to events of the DOM
147
147
element that hosts an attribute directive, the `<p>` in this case.
148
148
149
-
<divclass="l-sub-section">
149
+
<divclass="alert is-helpful">
150
150
151
151
Of course you could reach into the DOM with standard JavaScript and attach event listeners manually.
152
152
There are at least three problems with _that_ approach:
Copy file name to clipboardExpand all lines: aio/content/guide/dependency-injection-in-action.md
+10-10
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@ application and don't need to be listed in any module.
25
25
Service classes can act as their own providers which is why defining them in the `@Injectable` decorator
26
26
is all the registration you need.
27
27
28
-
<divclass="l-sub-section">
28
+
<divclass="alert is-helpful">
29
29
30
30
31
31
@@ -167,7 +167,7 @@ that is visible only to the component and its children, if any.
167
167
You could also provide the `HeroService` to a *different* component elsewhere in the application.
168
168
That would result in a *different* instance of the service, living in a *different* injector.
169
169
170
-
<divclass="l-sub-section">
170
+
<divclass="alert is-helpful">
171
171
172
172
173
173
@@ -433,7 +433,7 @@ It may already have that value in its internal container.
433
433
If it doesn't, it may be able to make one with the help of a ***provider***.
434
434
A *provider* is a recipe for delivering a service associated with a *token*.
435
435
436
-
<divclass="l-sub-section">
436
+
<divclass="alert is-helpful">
437
437
438
438
439
439
@@ -577,7 +577,7 @@ The second provider substitutes the `DateLoggerService` for the `LoggerService`.
577
577
The `LoggerService` is already registered at the `AppComponent` level.
578
578
When _this component_ requests the `LoggerService`, it receives the `DateLoggerService` instead.
579
579
580
-
<divclass="l-sub-section">
580
+
<divclass="alert is-helpful">
581
581
582
582
583
583
@@ -645,7 +645,7 @@ The `HeroOfTheMonthComponent` constructor's `logger` parameter is typed as `Mini
645
645
Behind the scenes, Angular actually sets the `logger` parameter to the full service registered under the `LoggingService` token which happens to be the `DateLoggerService` that was [provided above](guide/dependency-injection-in-action#useclass).
646
646
647
647
648
-
<divclass="l-sub-section">
648
+
<divclass="alert is-helpful">
649
649
650
650
651
651
@@ -707,7 +707,7 @@ After some undisclosed work, the function returns the string of names
707
707
and Angular injects it into the `runnersUp` parameter of the `HeroOfTheMonthComponent`.
708
708
709
709
710
-
<divclass="l-sub-section">
710
+
<divclass="alert is-helpful">
711
711
712
712
713
713
@@ -769,7 +769,7 @@ A ***class-interface*** should define *only* the members that its consumers are
769
769
Such a narrowing interface helps decouple the concrete class from its consumers.
770
770
771
771
772
-
<divclass="l-sub-section">
772
+
<divclass="alert is-helpful">
773
773
774
774
775
775
@@ -866,7 +866,7 @@ and displays them in the order they arrive from the database.
866
866
867
867
868
868
869
-
<divclass="l-sub-section">
869
+
<divclass="alert is-helpful">
870
870
871
871
872
872
@@ -982,7 +982,7 @@ If you're lucky, they all implement the same base class
982
982
whose API your `NewsComponent` understands.
983
983
984
984
985
-
<divclass="l-sub-section">
985
+
<divclass="alert is-helpful">
986
986
987
987
988
988
@@ -1165,7 +1165,7 @@ its class signature doesn't mention `Parent`:
0 commit comments