@angular/core 6.0.6 → 6.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@ import { Provider } from '../di/provider';
2
2
  import { Type } from '../type';
3
3
  import { TypeDecorator } from '../util/decorators';
4
4
  /**
5
- * A wrapper around a module that also includes the providers.
5
+ * A wrapper around an NgModule that associates it with the providers.
6
6
  *
7
7
  *
8
8
  */
@@ -11,7 +11,11 @@ export interface ModuleWithProviders {
11
11
  providers?: Provider[];
12
12
  }
13
13
  /**
14
- * Interface for schema definitions in @NgModules.
14
+ * A schema definition associated with an NgModule.
15
+ *
16
+ * @see `@NgModule`, `CUSTOM_ELEMENTS_SCHEMA`, `NO_ERRORS_SCHEMA`
17
+ *
18
+ * @param name The name of a defined schema.
15
19
  *
16
20
  * @experimental
17
21
  */
@@ -19,16 +23,16 @@ export interface SchemaMetadata {
19
23
  name: string;
20
24
  }
21
25
  /**
22
- * Defines a schema that will allow:
23
- * - any non-Angular elements with a `-` in their name,
24
- * - any properties on elements with a `-` in their name which is the common rule for custom
25
- * elements.
26
+ * Defines a schema that allows an NgModule to contain the following:
27
+ * - Non-Angular elements named with dash case (`-`).
28
+ * - Element properties named with dash case (`-`).
29
+ * Dash case is the naming convention for custom elements.
26
30
  *
27
31
  *
28
32
  */
29
33
  export declare const CUSTOM_ELEMENTS_SCHEMA: SchemaMetadata;
30
34
  /**
31
- * Defines a schema that will allow any property on any element.
35
+ * Defines a schema that allows any property on any element.
32
36
  *
33
37
  * @experimental
34
38
  */
@@ -40,7 +44,7 @@ export declare const NO_ERRORS_SCHEMA: SchemaMetadata;
40
44
  */
41
45
  export interface NgModuleDecorator {
42
46
  /**
43
- * Defines an NgModule.
47
+ * Marks a class as an NgModule and supplies configuration metadata.
44
48
  */
45
49
  (obj?: NgModule): TypeDecorator;
46
50
  new (obj?: NgModule): NgModule;
@@ -52,12 +56,13 @@ export interface NgModuleDecorator {
52
56
  */
53
57
  export interface NgModule {
54
58
  /**
55
- * Defines the set of injectable objects that are available in the injector
59
+ * The set of injectable objects that are available in the injector
56
60
  * of this module.
57
61
  *
58
- * ## Simple Example
62
+ * @usageNotes
59
63
  *
60
- * Here is an example of a class that can be injected:
64
+ * The following example defines a class that is injected in
65
+ * the HelloWorld NgModule:
61
66
  *
62
67
  * ```
63
68
  * class Greeter {
@@ -82,9 +87,12 @@ export interface NgModule {
82
87
  */
83
88
  providers?: Provider[];
84
89
  /**
85
- * Specifies a list of directives/pipes that belong to this module.
90
+ * The set of directives and pipes that belong to this module.
91
+ *
92
+ * @usageNotes
86
93
  *
87
- * ### Example
94
+ * The following example allows the CommonModule to use the `NgFor`
95
+ * directive.
88
96
  *
89
97
  * ```javascript
90
98
  * @NgModule({
@@ -96,11 +104,13 @@ export interface NgModule {
96
104
  */
97
105
  declarations?: Array<Type<any> | any[]>;
98
106
  /**
99
- * Specifies a list of modules whose exported directives/pipes
100
- * should be available to templates in this module.
101
- * This can also contain {@link ModuleWithProviders}.
107
+ * The set of NgModules, with or without providers,
108
+ * whose exported directives/pipes
109
+ * are available to templates in this module.
102
110
  *
103
- * ### Example
111
+ * @usageNotes
112
+ *
113
+ * The following example allows MainModule to use CommonModule:
104
114
  *
105
115
  * ```javascript
106
116
  * @NgModule({
@@ -109,14 +119,17 @@ export interface NgModule {
109
119
  * class MainModule {
110
120
  * }
111
121
  * ```
122
+ * @see {@link ModuleWithProviders}
112
123
  */
113
124
  imports?: Array<Type<any> | ModuleWithProviders | any[]>;
114
125
  /**
115
- * Specifies a list of directives/pipes/modules that can be used within the template
116
- * of any component that is part of an Angular module
117
- * that imports this Angular module.
126
+ * The set of directives, pipe, and NgModules that can be used
127
+ * within the template of any component that is part of an
128
+ * NgModule that imports this NgModule.
129
+ *
130
+ * @usageNotes
118
131
  *
119
- * ### Example
132
+ * The following example exports the `NgFor` directive from CommonModule.
120
133
  *
121
134
  * ```javascript
122
135
  * @NgModule({
@@ -128,40 +141,38 @@ export interface NgModule {
128
141
  */
129
142
  exports?: Array<Type<any> | any[]>;
130
143
  /**
131
- * Specifies a list of components that should be compiled when this module is defined.
132
- * For each component listed here, Angular will create a {@link ComponentFactory}
133
- * and store it in the {@link ComponentFactoryResolver}.
144
+ * The set of components to compile when this NgModule is defined.
145
+ * For each component listed here, Angular creates a `ComponentFactory`
146
+ * and stores it in the `ComponentFactoryResolver`.
134
147
  */
135
148
  entryComponents?: Array<Type<any> | any[]>;
136
149
  /**
137
- * Defines the components that should be bootstrapped when
150
+ * The set of components that are bootstrapped when
138
151
  * this module is bootstrapped. The components listed here
139
- * will automatically be added to `entryComponents`.
152
+ * are automatically added to `entryComponents`.
140
153
  */
141
154
  bootstrap?: Array<Type<any> | any[]>;
142
155
  /**
143
- * Elements and properties that are not Angular components nor directives have to be declared in
144
- * the schema.
156
+ * The set of schemas that declare elements to be allowed in the NgModule.
157
+ * Elements and properties that are neither Angular components nor directives
158
+ * must be declared in a schema.
145
159
  *
146
- * Available schemas:
147
- * - `NO_ERRORS_SCHEMA`: any elements and properties are allowed,
148
- * - `CUSTOM_ELEMENTS_SCHEMA`: any custom elements (tag name has "-") with any properties are
149
- * allowed.
160
+ * Allowed value are `NO_ERRORS_SCHEMA` and `CUSTOM_ELEMENTS_SCHEMA`.
150
161
  *
151
- * @security When using one of `NO_ERRORS_SCHEMA` or `CUSTOM_ELEMENTS_SCHEMA` we're trusting that
152
- * allowed elements (and its properties) securely escape inputs.
162
+ * @security When using one of `NO_ERRORS_SCHEMA` or `CUSTOM_ELEMENTS_SCHEMA`
163
+ * you must ensure that allowed elements and properties securely escape inputs.
153
164
  */
154
165
  schemas?: Array<SchemaMetadata | any[]>;
155
166
  /**
156
- * An opaque ID for this module, e.g. a name or a path. Used to identify modules in
157
- * `getModuleFactory`. If left `undefined`, the `NgModule` will not be registered with
167
+ * A name or path that uniquely identifies this NgModule in `getModuleFactory`.
168
+ * If left `undefined`, the NgModule is not registered with
158
169
  * `getModuleFactory`.
159
170
  */
160
171
  id?: string;
161
172
  }
162
173
  /**
163
- * NgModule decorator and metadata.
164
- *
174
+ * Decorator that marks the following class as an NgModule, and supplies
175
+ * configuration metadata for it.
165
176
  *
166
177
  * @Annotation
167
178
  */