@angular/core 2.2.0-rc.0 → 2.2.3
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.
- package/bundles/core-testing.umd.js +44 -11
- package/bundles/core.umd.js +560 -513
- package/bundles/core.umd.min.js +8 -8
- package/package.json +1 -1
- package/src/animation/animation_group_player.d.ts +3 -1
- package/src/animation/animation_group_player.js +18 -7
- package/src/animation/animation_group_player.js.map +1 -1
- package/src/animation/animation_player.d.ts +1 -1
- package/src/animation/animation_player.js +1 -1
- package/src/animation/animation_player.js.map +1 -1
- package/src/animation/animation_queue.js +8 -0
- package/src/animation/animation_queue.js.map +1 -1
- package/src/animation/animation_sequence_player.d.ts +3 -1
- package/src/animation/animation_sequence_player.js +20 -8
- package/src/animation/animation_sequence_player.js.map +1 -1
- package/src/animation/animation_style_util.js +1 -0
- package/src/animation/animation_style_util.js.map +1 -1
- package/src/animation/animation_style_util.metadata.json +1 -1
- package/src/animation/metadata.js.map +1 -1
- package/src/animation/view_animation_map.js.map +1 -1
- package/src/change_detection/constants.d.ts +1 -1
- package/src/change_detection/constants.js +1 -1
- package/src/change_detection/constants.js.map +1 -1
- package/src/change_detection/differs/default_iterable_differ.js +2 -2
- package/src/change_detection/differs/default_iterable_differ.js.map +1 -1
- package/src/change_detection/differs/default_keyvalue_differ.js.map +1 -1
- package/src/change_detection/differs/iterable_differs.js.map +1 -1
- package/src/change_detection/differs/keyvalue_differs.js.map +1 -1
- package/src/core_private_export.d.ts +8 -3
- package/src/core_private_export.js +6 -2
- package/src/core_private_export.js.map +1 -1
- package/src/core_private_export.metadata.json +1 -1
- package/src/debug/debug_node.js +12 -24
- package/src/debug/debug_node.js.map +1 -1
- package/src/debug/debug_node.metadata.json +1 -1
- package/src/debug/debug_renderer.d.ts +2 -2
- package/src/debug/debug_renderer.js +7 -5
- package/src/debug/debug_renderer.js.map +1 -1
- package/src/di/reflective_errors.js.map +1 -1
- package/src/di/reflective_injector.js.map +1 -1
- package/src/di/reflective_key.js.map +1 -1
- package/src/di/reflective_provider.js +13 -14
- package/src/di/reflective_provider.js.map +1 -1
- package/src/facade/collection.d.ts +2 -10
- package/src/facade/collection.js +8 -73
- package/src/facade/collection.js.map +1 -1
- package/src/facade/lang.d.ts +0 -1
- package/src/facade/lang.js +5 -24
- package/src/facade/lang.js.map +1 -1
- package/src/facade/lang.metadata.json +1 -1
- package/src/linker/animation_view_context.d.ts +1 -1
- package/src/linker/animation_view_context.js +16 -5
- package/src/linker/animation_view_context.js.map +1 -1
- package/src/linker/component_factory.d.ts +8 -6
- package/src/linker/component_factory.js +17 -23
- package/src/linker/component_factory.js.map +1 -1
- package/src/linker/component_factory_resolver.js.map +1 -1
- package/src/linker/debug_context.js +6 -9
- package/src/linker/debug_context.js.map +1 -1
- package/src/linker/element_injector.js +1 -8
- package/src/linker/element_injector.js.map +1 -1
- package/src/linker/ng_module_factory.js.map +1 -1
- package/src/linker/ng_module_factory_loader.js.map +1 -1
- package/src/linker/system_js_ng_module_factory_loader.js +2 -1
- package/src/linker/system_js_ng_module_factory_loader.js.map +1 -1
- package/src/linker/template_ref.d.ts +5 -4
- package/src/linker/template_ref.js +8 -6
- package/src/linker/template_ref.js.map +1 -1
- package/src/linker/view.d.ts +29 -17
- package/src/linker/view.js +143 -51
- package/src/linker/view.js.map +1 -1
- package/src/linker/{element.d.ts → view_container.d.ts} +4 -7
- package/src/linker/{element.js → view_container.js} +45 -50
- package/src/linker/view_container.js.map +1 -0
- package/src/linker/view_container_ref.d.ts +2 -2
- package/src/linker/view_container_ref.js.map +1 -1
- package/src/linker/view_utils.d.ts +6 -10
- package/src/linker/view_utils.js +17 -14
- package/src/linker/view_utils.js.map +1 -1
- package/src/linker/view_utils.metadata.json +1 -1
- package/src/profile/wtf_impl.js.map +1 -1
- package/src/reflection/reflection_capabilities.js +5 -2
- package/src/reflection/reflection_capabilities.js.map +1 -1
- package/src/render/api.d.ts +8 -1
- package/src/render/api.js.map +1 -1
- package/src/testability/testability.js +2 -3
- package/src/testability/testability.js.map +1 -1
- package/src/util/decorators.js.map +1 -1
- package/testing/async.js.map +1 -1
- package/testing/facade/lang.d.ts +0 -1
- package/testing/facade/lang.js +5 -24
- package/testing/facade/lang.js.map +1 -1
- package/testing/facade/lang.metadata.json +1 -1
- package/testing/fake_async.js.map +1 -1
- package/testing/mock_animation_player.d.ts +16 -1
- package/testing/mock_animation_player.js +43 -14
- package/testing/mock_animation_player.js.map +1 -1
- package/testing/test_bed.js.map +1 -1
- package/testing/testing.js.map +1 -1
- package/src/linker/element.js.map +0 -1
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
import { ChangeDetectorRef } from '../change_detection/change_detection';
|
|
9
9
|
import { Injector } from '../di/injector';
|
|
10
10
|
import { Type } from '../type';
|
|
11
|
-
import { AppElement } from './element';
|
|
12
11
|
import { ElementRef } from './element_ref';
|
|
12
|
+
import { AppView } from './view';
|
|
13
13
|
import { ViewRef } from './view_ref';
|
|
14
14
|
/**
|
|
15
15
|
* Represents an instance of a Component created via a {@link ComponentFactory}.
|
|
@@ -54,9 +54,11 @@ export declare abstract class ComponentRef<C> {
|
|
|
54
54
|
abstract onDestroy(callback: Function): void;
|
|
55
55
|
}
|
|
56
56
|
export declare class ComponentRef_<C> extends ComponentRef<C> {
|
|
57
|
-
private
|
|
58
|
-
private
|
|
59
|
-
|
|
57
|
+
private _index;
|
|
58
|
+
private _parentView;
|
|
59
|
+
private _nativeElement;
|
|
60
|
+
private _component;
|
|
61
|
+
constructor(_index: number, _parentView: AppView<any>, _nativeElement: any, _component: C);
|
|
60
62
|
location: ElementRef;
|
|
61
63
|
injector: Injector;
|
|
62
64
|
instance: C;
|
|
@@ -71,9 +73,9 @@ export declare class ComponentRef_<C> extends ComponentRef<C> {
|
|
|
71
73
|
*/
|
|
72
74
|
export declare class ComponentFactory<C> {
|
|
73
75
|
selector: string;
|
|
74
|
-
private
|
|
76
|
+
private _viewClass;
|
|
75
77
|
private _componentType;
|
|
76
|
-
constructor(selector: string,
|
|
78
|
+
constructor(selector: string, _viewClass: Type<AppView<any>>, _componentType: Type<any>);
|
|
77
79
|
componentType: Type<any>;
|
|
78
80
|
/**
|
|
79
81
|
* Creates a new component.
|
|
@@ -11,6 +11,7 @@ var __extends = (this && this.__extends) || function (d, b) {
|
|
|
11
11
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
12
12
|
};
|
|
13
13
|
import { unimplemented } from '../facade/errors';
|
|
14
|
+
import { ElementRef } from './element_ref';
|
|
14
15
|
import { ViewUtils } from './view_utils';
|
|
15
16
|
/**
|
|
16
17
|
* Represents an instance of a Component created via a {@link ComponentFactory}.
|
|
@@ -77,45 +78,47 @@ export var ComponentRef = (function () {
|
|
|
77
78
|
}());
|
|
78
79
|
export var ComponentRef_ = (function (_super) {
|
|
79
80
|
__extends(ComponentRef_, _super);
|
|
80
|
-
function ComponentRef_(
|
|
81
|
+
function ComponentRef_(_index, _parentView, _nativeElement, _component) {
|
|
81
82
|
_super.call(this);
|
|
82
|
-
this.
|
|
83
|
-
this.
|
|
83
|
+
this._index = _index;
|
|
84
|
+
this._parentView = _parentView;
|
|
85
|
+
this._nativeElement = _nativeElement;
|
|
86
|
+
this._component = _component;
|
|
84
87
|
}
|
|
85
88
|
Object.defineProperty(ComponentRef_.prototype, "location", {
|
|
86
|
-
get: function () { return this.
|
|
89
|
+
get: function () { return new ElementRef(this._nativeElement); },
|
|
87
90
|
enumerable: true,
|
|
88
91
|
configurable: true
|
|
89
92
|
});
|
|
90
93
|
Object.defineProperty(ComponentRef_.prototype, "injector", {
|
|
91
|
-
get: function () { return this.
|
|
94
|
+
get: function () { return this._parentView.injector(this._index); },
|
|
92
95
|
enumerable: true,
|
|
93
96
|
configurable: true
|
|
94
97
|
});
|
|
95
98
|
Object.defineProperty(ComponentRef_.prototype, "instance", {
|
|
96
|
-
get: function () { return this.
|
|
99
|
+
get: function () { return this._component; },
|
|
97
100
|
enumerable: true,
|
|
98
101
|
configurable: true
|
|
99
102
|
});
|
|
100
103
|
;
|
|
101
104
|
Object.defineProperty(ComponentRef_.prototype, "hostView", {
|
|
102
|
-
get: function () { return this.
|
|
105
|
+
get: function () { return this._parentView.ref; },
|
|
103
106
|
enumerable: true,
|
|
104
107
|
configurable: true
|
|
105
108
|
});
|
|
106
109
|
;
|
|
107
110
|
Object.defineProperty(ComponentRef_.prototype, "changeDetectorRef", {
|
|
108
|
-
get: function () { return this.
|
|
111
|
+
get: function () { return this._parentView.ref; },
|
|
109
112
|
enumerable: true,
|
|
110
113
|
configurable: true
|
|
111
114
|
});
|
|
112
115
|
;
|
|
113
116
|
Object.defineProperty(ComponentRef_.prototype, "componentType", {
|
|
114
|
-
get: function () { return this.
|
|
117
|
+
get: function () { return this._component.constructor; },
|
|
115
118
|
enumerable: true,
|
|
116
119
|
configurable: true
|
|
117
120
|
});
|
|
118
|
-
ComponentRef_.prototype.destroy = function () { this.
|
|
121
|
+
ComponentRef_.prototype.destroy = function () { this._parentView.detachAndDestroy(); };
|
|
119
122
|
ComponentRef_.prototype.onDestroy = function (callback) { this.hostView.onDestroy(callback); };
|
|
120
123
|
return ComponentRef_;
|
|
121
124
|
}(ComponentRef));
|
|
@@ -127,9 +130,9 @@ var EMPTY_CONTEXT = new Object();
|
|
|
127
130
|
* @stable
|
|
128
131
|
*/
|
|
129
132
|
export var ComponentFactory = (function () {
|
|
130
|
-
function ComponentFactory(selector,
|
|
133
|
+
function ComponentFactory(selector, _viewClass, _componentType) {
|
|
131
134
|
this.selector = selector;
|
|
132
|
-
this.
|
|
135
|
+
this._viewClass = _viewClass;
|
|
133
136
|
this._componentType = _componentType;
|
|
134
137
|
}
|
|
135
138
|
Object.defineProperty(ComponentFactory.prototype, "componentType", {
|
|
@@ -147,17 +150,8 @@ export var ComponentFactory = (function () {
|
|
|
147
150
|
if (!projectableNodes) {
|
|
148
151
|
projectableNodes = [];
|
|
149
152
|
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
hostView.visitProjectableNodesInternal =
|
|
153
|
-
function (nodeIndex, ngContentIndex, cb, ctx) {
|
|
154
|
-
var nodes = projectableNodes[ngContentIndex] || [];
|
|
155
|
-
for (var i = 0; i < nodes.length; i++) {
|
|
156
|
-
cb(nodes[i], ctx);
|
|
157
|
-
}
|
|
158
|
-
};
|
|
159
|
-
var hostElement = hostView.create(EMPTY_CONTEXT, rootSelectorOrNode);
|
|
160
|
-
return new ComponentRef_(hostElement, this._componentType);
|
|
153
|
+
var hostView = new this._viewClass(vu, null, null, null);
|
|
154
|
+
return hostView.createHostView(rootSelectorOrNode, injector, projectableNodes);
|
|
161
155
|
};
|
|
162
156
|
return ComponentFactory;
|
|
163
157
|
}());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component_factory.js","sourceRoot":"","sources":["../../../../../modules/@angular/core/src/linker/component_factory.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;;;;;OAII,EAAC,aAAa,EAAC,MAAM,kBAAkB;
|
|
1
|
+
{"version":3,"file":"component_factory.js","sourceRoot":"","sources":["../../../../../modules/@angular/core/src/linker/component_factory.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;;;;;OAII,EAAC,aAAa,EAAC,MAAM,kBAAkB;OAGvC,EAAC,UAAU,EAAC,MAAM,eAAe;OAIjC,EAAC,SAAS,EAAC,MAAM,cAAc;AAItC;;;;;;;GAOG;AACH;IAAA;IAwCA,CAAC;IApCC,sBAAI,kCAAQ;QAHZ;;WAEG;aACH,cAA6B,MAAM,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC;;;OAAA;IAKtD,sBAAI,kCAAQ;QAHZ;;WAEG;aACH,cAA2B,MAAM,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC;;;OAAA;IAKpD,sBAAI,kCAAQ;QAHZ;;WAEG;aACH,cAAoB,MAAM,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC;;;OAAA;;IAK7C,sBAAI,kCAAQ;QAHZ;;WAEG;aACH,cAA0B,M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W,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC;IACxD,iCAAS,GAAT,UAAU,QAAkB,IAAU,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC5E,oBAAC;AAAD,CAAC,AAfD,CAAsC,YAAY,GAejD;AAED;;GAEG;AACH,IAAM,aAAa,GAAG,IAAI,MAAM,EAAE,CAAC;AAEnC;;GAEG;AACH;IACE,0BACW,QAAgB,EAAU,UAA8B,EACvD,cAAyB;QAD1B,aAAQ,GAAR,QAAQ,CAAQ;QAAU,eAAU,GAAV,UAAU,CAAoB;QACvD,mBAAc,GAAd,cAAc,CAAW;IAAG,CAAC;IAEzC,sBAAI,2CAAa;aAAjB,cAAiC,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC;;;OAAA;IAE9D;;OAEG;IACH,iCAAM,GAAN,UACI,QAAkB,EAAE,gBAAgC,EACpD,kBAAqC;QADjB,gCAAgC,GAAhC,uBAAgC;QACpD,kCAAqC,GAArC,yBAAqC;QACvC,IAAM,EAAE,GAAc,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QAC9C,EAAE,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC;YACtB,gBAAgB,GAAG,EAAE,CAAC;QACxB,CAAC;QACD,IAAM,QAAQ,GAAiB,IAAI,IAAI,CAAC,UAAU,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QACzE,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAC,kBAAkB,EAAE,QAAQ,EAAE,gBAAgB,CAAC,CAAC;IACjF,CAAC;IACH,uBAAC;AAAD,CAAC,AApBD,IAoBC","sourcesContent":["/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ChangeDetectorRef} from '../change_detection/change_detection';\nimport {Injector} from '../di/injector';\nimport {unimplemented} from '../facade/errors';\nimport {Type} from '../type';\n\nimport {ElementRef} from './element_ref';\nimport {AppView} from './view';\nimport {ViewContainer} from './view_container';\nimport {ViewRef} from './view_ref';\nimport {ViewUtils} from './view_utils';\n\n\n\n/**\n * Represents an instance of a Component created via a {@link ComponentFactory}.\n *\n * `ComponentRef` provides access to the Component Instance as well other objects related to this\n * Component Instance and allows you to destroy the Component Instance via the {@link #destroy}\n * method.\n * @stable\n */\nexport abstract class ComponentRef<C> {\n /**\n * Location of the Host Element of this Component Instance.\n */\n get location(): ElementRef { return unimplemented(); }\n\n /**\n * The injector on which the component instance exists.\n */\n get injector(): Injector { return unimplemented(); }\n\n /**\n * The instance of the Component.\n */\n get instance(): C { return unimplemented(); };\n\n /**\n * The {@link ViewRef} of the Host View of this Component instance.\n */\n get hostView(): ViewRef { return unimplemented(); };\n\n /**\n * The {@link ChangeDetectorRef} of the Component instance.\n */\n get changeDetectorRef(): ChangeDetectorRef { return unimplemented(); }\n\n /**\n * The component type.\n */\n get componentType(): Type<any> { return unimplemented(); }\n\n /**\n * Destroys the component instance and all of the data structures associated with it.\n */\n abstract destroy(): void;\n\n /**\n * Allows to register a callback that will be called when the component is destroyed.\n */\n abstract onDestroy(callback: Function): void;\n}\n\nexport class ComponentRef_<C> extends ComponentRef<C> {\n constructor(\n private _index: number, private _parentView: AppView<any>, private _nativeElement: any,\n private _component: C) {\n super();\n }\n get location(): ElementRef { return new ElementRef(this._nativeElement); }\n get injector(): Injector { return this._parentView.injector(this._index); }\n get instance(): C { return this._component; };\n get hostView(): ViewRef { return this._parentView.ref; };\n get changeDetectorRef(): ChangeDetectorRef { return this._parentView.ref; };\n get componentType(): Type<any> { return <any>this._component.constructor; }\n\n destroy(): void { this._parentView.detachAndDestroy(); }\n onDestroy(callback: Function): void { this.hostView.onDestroy(callback); }\n}\n\n/**\n * @experimental\n */\nconst EMPTY_CONTEXT = new Object();\n\n/**\n * @stable\n */\nexport class ComponentFactory<C> {\n constructor(\n public selector: string, private _viewClass: Type<AppView<any>>,\n private _componentType: Type<any>) {}\n\n get componentType(): Type<any> { return this._componentType; }\n\n /**\n * Creates a new component.\n */\n create(\n injector: Injector, projectableNodes: any[][] = null,\n rootSelectorOrNode: string|any = null): ComponentRef<C> {\n const vu: ViewUtils = injector.get(ViewUtils);\n if (!projectableNodes) {\n projectableNodes = [];\n }\n const hostView: AppView<any> = new this._viewClass(vu, null, null, null);\n return hostView.createHostView(rootSelectorOrNode, injector, projectableNodes);\n }\n}\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component_factory_resolver.js","sourceRoot":"","sources":["../../../../../modules/@angular/core/src/linker/component_factory_resolver.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;;;;;OAEI,EAAC,SAAS,EAAC,MAAM,kBAAkB;OACnC,EAAC,SAAS,EAAC,MAAM,gBAAgB;AAOxC;;GAEG;AACH;IAA6C,2CAAS;IACpD,iCAAmB,SAAmB;QACpC,kBAAM,oCAAkC,SAAS,CAAC,SAAS,CAAG,CAAC,CAAC;QAD/C,cAAS,GAAT,SAAS,CAAU;IAEtC,CAAC;IACH,8BAAC;AAAD,CAAC,AAJD,CAA6C,SAAS,GAIrD;AAED;IAAA;IAIA,CAAC;IAHC,+DAAuB,GAAvB,UAA2B,SAAoC;QAC7D,MAAM,IAAI,uBAAuB,CAAC,SAAS,CAAC,CAAC;IAC/C,CAAC;IACH,oCAAC;AAAD,CAAC,AAJD,IAIC;AAED;;GAEG;AACH;IAAA;IAGA,CAAC;IAFQ,6BAAI,GAA6B,IAAI,6BAA6B,EAAE,CAAC;IAE9E,+BAAC;AAAD,CAAC,AAHD,IAGC;AAED;IAGE,yCAAY,SAAkC,EAAU,OAAiC;QAAjC,YAAO,GAAP,OAAO,CAA0B;QAFjF,eAAU,GAAG,IAAI,GAAG,EAA8B,CAAC;QAGzD,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAC1C,
|
|
1
|
+
{"version":3,"file":"component_factory_resolver.js","sourceRoot":"","sources":["../../../../../modules/@angular/core/src/linker/component_factory_resolver.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;;;;;OAEI,EAAC,SAAS,EAAC,MAAM,kBAAkB;OACnC,EAAC,SAAS,EAAC,MAAM,gBAAgB;AAOxC;;GAEG;AACH;IAA6C,2CAAS;IACpD,iCAAmB,SAAmB;QACpC,kBAAM,oCAAkC,SAAS,CAAC,SAAS,CAAG,CAAC,CAAC;QAD/C,cAAS,GAAT,SAAS,CAAU;IAEtC,CAAC;IACH,8BAAC;AAAD,CAAC,AAJD,CAA6C,SAAS,GAIrD;AAED;IAAA;IAIA,CAAC;IAHC,+DAAuB,GAAvB,UAA2B,SAAoC;QAC7D,MAAM,IAAI,uBAAuB,CAAC,SAAS,CAAC,CAAC;IAC/C,CAAC;IACH,oCAAC;AAAD,CAAC,AAJD,IAIC;AAED;;GAEG;AACH;IAAA;IAGA,CAAC;IAFQ,6BAAI,GAA6B,IAAI,6BAA6B,EAAE,CAAC;IAE9E,+BAAC;AAAD,CAAC,AAHD,IAGC;AAED;IAGE,yCAAY,SAAkC,EAAU,OAAiC;QAAjC,YAAO,GAAP,OAAO,CAA0B;QAFjF,eAAU,GAAG,IAAI,GAAG,EAA8B,CAAC;QAGzD,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAC1C,IAAM,OAAO,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;YAC7B,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;QACtD,CAAC;IACH,CAAC;IAED,iEAAuB,GAAvB,UAA2B,SAAoC;QAC7D,IAAI,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QAC5C,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;YACZ,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;QAC3D,CAAC;QACD,MAAM,CAAC,MAAM,CAAC;IAChB,CAAC;IACH,sCAAC;AAAD,CAAC,AAjBD,IAiBC","sourcesContent":["/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {BaseError} from '../facade/errors';\nimport {stringify} from '../facade/lang';\nimport {Type} from '../type';\n\nimport {ComponentFactory} from './component_factory';\n\n\n\n/**\n * @stable\n */\nexport class NoComponentFactoryError extends BaseError {\n constructor(public component: Function) {\n super(`No component factory found for ${stringify(component)}`);\n }\n}\n\nclass _NullComponentFactoryResolver implements ComponentFactoryResolver {\n resolveComponentFactory<T>(component: {new (...args: any[]): T}): ComponentFactory<T> {\n throw new NoComponentFactoryError(component);\n }\n}\n\n/**\n * @stable\n */\nexport abstract class ComponentFactoryResolver {\n static NULL: ComponentFactoryResolver = new _NullComponentFactoryResolver();\n abstract resolveComponentFactory<T>(component: Type<T>): ComponentFactory<T>;\n}\n\nexport class CodegenComponentFactoryResolver implements ComponentFactoryResolver {\n private _factories = new Map<any, ComponentFactory<any>>();\n\n constructor(factories: ComponentFactory<any>[], private _parent: ComponentFactoryResolver) {\n for (let i = 0; i < factories.length; i++) {\n const factory = factories[i];\n this._factories.set(factory.componentType, factory);\n }\n }\n\n resolveComponentFactory<T>(component: {new (...args: any[]): T}): ComponentFactory<T> {\n let result = this._factories.get(component);\n if (!result) {\n result = this._parent.resolveComponentFactory(component);\n }\n return result;\n }\n}\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n"]}
|
|
@@ -48,13 +48,10 @@ export var DebugContext = (function () {
|
|
|
48
48
|
Object.defineProperty(DebugContext.prototype, "componentRenderElement", {
|
|
49
49
|
get: function () {
|
|
50
50
|
var componentView = this._view;
|
|
51
|
-
while (isPresent(componentView.
|
|
52
|
-
componentView
|
|
53
|
-
componentView = componentView.declarationAppElement.parentView;
|
|
51
|
+
while (isPresent(componentView.parentView) && componentView.type !== ViewType.COMPONENT) {
|
|
52
|
+
componentView = componentView.parentView;
|
|
54
53
|
}
|
|
55
|
-
return
|
|
56
|
-
componentView.declarationAppElement.nativeElement :
|
|
57
|
-
null;
|
|
54
|
+
return componentView.parentElement;
|
|
58
55
|
},
|
|
59
56
|
enumerable: true,
|
|
60
57
|
configurable: true
|
|
@@ -97,9 +94,9 @@ export var DebugContext = (function () {
|
|
|
97
94
|
var varValues = {};
|
|
98
95
|
var staticNodeInfo = this._staticNodeInfo;
|
|
99
96
|
if (isPresent(staticNodeInfo)) {
|
|
100
|
-
var
|
|
101
|
-
Object.keys(
|
|
102
|
-
var refToken =
|
|
97
|
+
var refs_1 = staticNodeInfo.refTokens;
|
|
98
|
+
Object.keys(refs_1).forEach(function (refName) {
|
|
99
|
+
var refToken = refs_1[refName];
|
|
103
100
|
var varValue;
|
|
104
101
|
if (isBlank(refToken)) {
|
|
105
102
|
varValue = _this._view.allNodes ? _this._view.allNodes[_this._nodeIndex] : null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debug_context.js","sourceRoot":"","sources":["../../../../../modules/@angular/core/src/linker/debug_context.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;OAGI,EAAC,OAAO,EAAE,SAAS,EAAC,MAAM,gBAAgB;OAI1C,EAAC,QAAQ,EAAC,MAAM,aAAa;AAGpC;IACE,6BACW,cAAqB,EAAS,cAAmB,EACjD,SAA+B;QAD/B,mBAAc,GAAd,cAAc,CAAO;QAAS,mBAAc,GAAd,cAAc,CAAK;QACjD,cAAS,GAAT,SAAS,CAAsB;IAAG,CAAC;IAChD,0BAAC;AAAD,CAAC,AA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C,CAAC;YACL,CAAC;YACD,MAAM,CAAC,SAAS,CAAC;QACnB,CAAC;;;OAAA;IACH,mBAAC;AAAD,CAAC,AAzDD,IAyDC","sourcesContent":["/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injector} from '../di';\nimport {isBlank, isPresent} from '../facade/lang';\nimport {RenderDebugInfo} from '../render/api';\n\nimport {DebugAppView} from './view';\nimport {ViewType} from './view_type';\n\n\nexport class StaticNodeDebugInfo {\n constructor(\n public providerTokens: any[], public componentToken: any,\n public refTokens: {[key: string]: any}) {}\n}\n\nexport class DebugContext implements RenderDebugInfo {\n constructor(\n private _view: DebugAppView<any>, private _nodeIndex: number, private _tplRow: number,\n private _tplCol: number) {}\n\n private get _staticNodeInfo(): StaticNodeDebugInfo {\n return isPresent(this._nodeIndex) ? this._view.staticNodeDebugInfos[this._nodeIndex] : null;\n }\n\n get context() { return this._view.context; }\n get component() {\n const staticNodeInfo = this._staticNodeInfo;\n if (isPresent(staticNodeInfo) && isPresent(staticNodeInfo.componentToken)) {\n return this.injector.get(staticNodeInfo.componentToken);\n }\n return null;\n }\n get componentRenderElement() {\n let componentView = this._view;\n while (isPresent(componentView.parentView) && componentView.type !== ViewType.COMPONENT) {\n componentView = <DebugAppView<any>>componentView.parentView;\n }\n return componentView.parentElement;\n }\n get injector(): Injector { return this._view.injector(this._nodeIndex); }\n get renderNode(): any {\n if (isPresent(this._nodeIndex) && this._view.allNodes) {\n return this._view.allNodes[this._nodeIndex];\n } else {\n return null;\n }\n }\n get providerTokens(): any[] {\n const staticNodeInfo = this._staticNodeInfo;\n return isPresent(staticNodeInfo) ? staticNodeInfo.providerTokens : null;\n }\n get source(): string {\n return `${this._view.componentType.templateUrl}:${this._tplRow}:${this._tplCol}`;\n }\n get references(): {[key: string]: any} {\n const varValues: {[key: string]: string} = {};\n const staticNodeInfo = this._staticNodeInfo;\n if (isPresent(staticNodeInfo)) {\n const refs = staticNodeInfo.refTokens;\n Object.keys(refs).forEach(refName => {\n const refToken = refs[refName];\n let varValue: any;\n if (isBlank(refToken)) {\n varValue = this._view.allNodes ? this._view.allNodes[this._nodeIndex] : null;\n } else {\n varValue = this._view.injectorGet(refToken, this._nodeIndex, null);\n }\n varValues[refName] = varValue;\n });\n }\n return varValues;\n }\n}\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n"]}
|
|
@@ -21,14 +21,7 @@ export var ElementInjector = (function (_super) {
|
|
|
21
21
|
}
|
|
22
22
|
ElementInjector.prototype.get = function (token, notFoundValue) {
|
|
23
23
|
if (notFoundValue === void 0) { notFoundValue = THROW_IF_NOT_FOUND; }
|
|
24
|
-
|
|
25
|
-
if (result === _UNDEFINED) {
|
|
26
|
-
result = this._view.injectorGet(token, this._nodeIndex, _UNDEFINED);
|
|
27
|
-
}
|
|
28
|
-
if (result === _UNDEFINED) {
|
|
29
|
-
result = this._view.parentInjector.get(token, notFoundValue);
|
|
30
|
-
}
|
|
31
|
-
return result;
|
|
24
|
+
return this._view.injectorGet(token, this._nodeIndex, notFoundValue);
|
|
32
25
|
};
|
|
33
26
|
return ElementInjector;
|
|
34
27
|
}(Injector));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"element_injector.js","sourceRoot":"","sources":["../../../../../modules/@angular/core/src/linker/element_injector.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;;;;;OAEI,EAAC,QAAQ,EAAE,kBAAkB,EAAC,MAAM,gBAAgB;AAG3D,IAAM,UAAU,GAAG,IAAI,MAAM,EAAE,CAAC;AAEhC;IAAqC,mCAAQ;IAC3C,yBAAoB,KAAmB,EAAU,UAAkB;QAAI,iBAAO,CAAC;QAA3D,UAAK,GAAL,KAAK,CAAc;QAAU,eAAU,GAAV,UAAU,CAAQ;IAAa,CAAC;IAEjF,6BAAG,GAAH,UAAI,KAAU,EAAE,aAAuC;QAAvC,6BAAuC,GAAvC,kCAAuC;QACrD,
|
|
1
|
+
{"version":3,"file":"element_injector.js","sourceRoot":"","sources":["../../../../../modules/@angular/core/src/linker/element_injector.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;;;;;OAEI,EAAC,QAAQ,EAAE,kBAAkB,EAAC,MAAM,gBAAgB;AAG3D,IAAM,UAAU,GAAG,IAAI,MAAM,EAAE,CAAC;AAEhC;IAAqC,mCAAQ;IAC3C,yBAAoB,KAAmB,EAAU,UAAkB;QAAI,iBAAO,CAAC;QAA3D,UAAK,GAAL,KAAK,CAAc;QAAU,eAAU,GAAV,UAAU,CAAQ;IAAa,CAAC;IAEjF,6BAAG,GAAH,UAAI,KAAU,EAAE,aAAuC;QAAvC,6BAAuC,GAAvC,kCAAuC;QACrD,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;IACvE,CAAC;IACH,sBAAC;AAAD,CAAC,AAND,CAAqC,QAAQ,GAM5C","sourcesContent":["/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injector, THROW_IF_NOT_FOUND} from '../di/injector';\nimport {AppView} from './view';\n\nconst _UNDEFINED = new Object();\n\nexport class ElementInjector extends Injector {\n constructor(private _view: AppView<any>, private _nodeIndex: number) { super(); }\n\n get(token: any, notFoundValue: any = THROW_IF_NOT_FOUND): any {\n return this._view.injectorGet(token, this._nodeIndex, notFoundValue);\n }\n}\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng_module_factory.js","sourceRoot":"","sources":["../../../../../modules/@angular/core/src/linker/ng_module_factory.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;;;;;OAEI,EAAC,QAAQ,EAAE,kBAAkB,EAAC,MAAM,gBAAgB;OACpD,EAAC,aAAa,EAAC,MAAM,kBAAkB;OACvC,EAAC,SAAS,EAAC,MAAM,gBAAgB;OAGjC,EAAC,+BAA+B,EAAE,wBAAwB,EAAC,MAAM,8BAA8B;AAItG;;;;;;;GAOG;AACH;IAAA;IA0BA,CAAC;IAtBC,sBAAI,iCAAQ;QAHZ;;WAEG;aACH,cAA2B,MAAM,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC;;;OAAA;IAMpD,sBAAI,iDAAwB;QAJ5B;;;WAGG;aACH,cAA2D,MAAM,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC;;;OAAA;IAKpF,sBAAI,iCAAQ;QAHZ;;WAEG;aACH,cAAoB,MAAM,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC;;;OAAA;IAW/C,kBAAC;AAAD,CAAC,AA1BD,IA0BC;AAED;;GAEG;AACH;IACE,yBACY,cAAqE,EACrE,WAAoB;QADpB,mBAAc,GAAd,cAAc,CAAuD;QACrE,gBAAW,GAAX,WAAW,CAAS;IAAG,CAAC;IAEpC,sBAAI,uCAAU;aAAd,cAA4B,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;;;OAAA;IAEtD,gCAAM,GAAN,UAAO,cAAwB;QAC7B,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC;YACpB,cAAc,GAAG,QAAQ,CAAC,IAAI,CAAC;QACjC,CAAC;QACD,
|
|
1
|
+
{"version":3,"file":"ng_module_factory.js","sourceRoot":"","sources":["../../../../../modules/@angular/core/src/linker/ng_module_factory.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;;;;;OAEI,EAAC,QAAQ,EAAE,kBAAkB,EAAC,MAAM,gBAAgB;OACpD,EAAC,aAAa,EAAC,MAAM,kBAAkB;OACvC,EAAC,SAAS,EAAC,MAAM,gBAAgB;OAGjC,EAAC,+BAA+B,EAAE,wBAAwB,EAAC,MAAM,8BAA8B;AAItG;;;;;;;GAOG;AACH;IAAA;IA0BA,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AA7CD,CAAkD,+BAA+B,GA6ChF","sourcesContent":["/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injector, THROW_IF_NOT_FOUND} from '../di/injector';\nimport {unimplemented} from '../facade/errors';\nimport {stringify} from '../facade/lang';\nimport {Type} from '../type';\nimport {ComponentFactory} from './component_factory';\nimport {CodegenComponentFactoryResolver, ComponentFactoryResolver} from './component_factory_resolver';\n\n\n\n/**\n * Represents an instance of an NgModule created via a {@link NgModuleFactory}.\n *\n * `NgModuleRef` provides access to the NgModule Instance as well other objects related to this\n * NgModule Instance.\n *\n * @stable\n */\nexport abstract class NgModuleRef<T> {\n /**\n * The injector that contains all of the providers of the NgModule.\n */\n get injector(): Injector { return unimplemented(); }\n\n /**\n * The ComponentFactoryResolver to get hold of the ComponentFactories\n * declared in the `entryComponents` property of the module.\n */\n get componentFactoryResolver(): ComponentFactoryResolver { return unimplemented(); }\n\n /**\n * The NgModule instance.\n */\n get instance(): T { return unimplemented(); }\n\n /**\n * Destroys the module instance and all of the data structures associated with it.\n */\n abstract destroy(): void;\n\n /**\n * Allows to register a callback that will be called when the module is destroyed.\n */\n abstract onDestroy(callback: () => void): void;\n}\n\n/**\n * @experimental\n */\nexport class NgModuleFactory<T> {\n constructor(\n private _injectorClass: {new (parentInjector: Injector): NgModuleInjector<T>},\n private _moduleType: Type<T>) {}\n\n get moduleType(): Type<T> { return this._moduleType; }\n\n create(parentInjector: Injector): NgModuleRef<T> {\n if (!parentInjector) {\n parentInjector = Injector.NULL;\n }\n const instance = new this._injectorClass(parentInjector);\n instance.create();\n return instance;\n }\n}\n\nconst _UNDEFINED = new Object();\n\nexport abstract class NgModuleInjector<T> extends CodegenComponentFactoryResolver implements\n Injector,\n NgModuleRef<T> {\n private _destroyListeners: (() => void)[] = [];\n private _destroyed: boolean = false;\n\n public instance: T;\n\n constructor(\n public parent: Injector, factories: ComponentFactory<any>[],\n public bootstrapFactories: ComponentFactory<any>[]) {\n super(factories, parent.get(ComponentFactoryResolver, ComponentFactoryResolver.NULL));\n }\n\n create() { this.instance = this.createInternal(); }\n\n abstract createInternal(): T;\n\n get(token: any, notFoundValue: any = THROW_IF_NOT_FOUND): any {\n if (token === Injector || token === ComponentFactoryResolver) {\n return this;\n }\n const result = this.getInternal(token, _UNDEFINED);\n return result === _UNDEFINED ? this.parent.get(token, notFoundValue) : result;\n }\n\n abstract getInternal(token: any, notFoundValue: any): any;\n\n get injector(): Injector { return this; }\n\n get componentFactoryResolver(): ComponentFactoryResolver { return this; }\n\n destroy(): void {\n if (this._destroyed) {\n throw new Error(\n `The ng module ${stringify(this.instance.constructor)} has already been destroyed.`);\n }\n this._destroyed = true;\n this.destroyInternal();\n this._destroyListeners.forEach((listener) => listener());\n }\n\n onDestroy(callback: () => void): void { this._destroyListeners.push(callback); }\n\n abstract destroyInternal(): void;\n}\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng_module_factory_loader.js","sourceRoot":"","sources":["../../../../../modules/@angular/core/src/linker/ng_module_factory_loader.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH;;;GAGG;AACH;IAAA;IAEA,CAAC;IAAD,4BAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,eAAe,GAAG,IAAI,GAAG,EAAgC,CAAC;AAE9D;;;GAGG;AACH,sCAAsC,EAAU,EAAE,OAA6B;IAC7E,
|
|
1
|
+
{"version":3,"file":"ng_module_factory_loader.js","sourceRoot":"","sources":["../../../../../modules/@angular/core/src/linker/ng_module_factory_loader.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH;;;GAGG;AACH;IAAA;IAEA,CAAC;IAAD,4BAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,eAAe,GAAG,IAAI,GAAG,EAAgC,CAAC;AAE9D;;;GAGG;AACH,sCAAsC,EAAU,EAAE,OAA6B;IAC7E,IAAM,QAAQ,GAAG,eAAe,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACzC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,qCAAmC,EAAE,WAC/B,QAAQ,CAAC,UAAU,CAAC,IAAI,YAAO,OAAO,CAAC,UAAU,CAAC,IAAM,CAAC,CAAC;IAClF,CAAC;IACD,eAAe,CAAC,GAAG,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;AACnC,CAAC;AAED;IACE,eAAe,GAAG,IAAI,GAAG,EAAgC,CAAC;AAC5D,CAAC;AAED;;;;;GAKG;AACH,iCAAiC,EAAU;IACzC,IAAM,OAAO,GAAG,eAAe,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACxC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;QAAC,MAAM,IAAI,KAAK,CAAC,uBAAqB,EAAE,YAAS,CAAC,CAAC;IAChE,MAAM,CAAC,OAAO,CAAC;AACjB,CAAC","sourcesContent":["/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NgModuleFactory} from './ng_module_factory';\n\n/**\n * Used to load ng module factories.\n * @stable\n */\nexport abstract class NgModuleFactoryLoader {\n abstract load(path: string): Promise<NgModuleFactory<any>>;\n}\n\nlet moduleFactories = new Map<string, NgModuleFactory<any>>();\n\n/**\n * Registers a loaded module. Should only be called from generated NgModuleFactory code.\n * @experimental\n */\nexport function registerModuleFactory(id: string, factory: NgModuleFactory<any>) {\n const existing = moduleFactories.get(id);\n if (existing) {\n throw new Error(`Duplicate module registered for ${id\n } - ${existing.moduleType.name} vs ${factory.moduleType.name}`);\n }\n moduleFactories.set(id, factory);\n}\n\nexport function clearModulesForTest() {\n moduleFactories = new Map<string, NgModuleFactory<any>>();\n}\n\n/**\n * Returns the NgModuleFactory with the given id, if it exists and has been loaded.\n * Factories for modules that do not specify an `id` cannot be retrieved. Throws if the module\n * cannot be found.\n * @experimental\n */\nexport function getModuleFactory(id: string): NgModuleFactory<any> {\n const factory = moduleFactories.get(id);\n if (!factory) throw new Error(`No module with ID ${id} loaded`);\n return factory;\n}\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n"]}
|
|
@@ -40,8 +40,9 @@ export var SystemJsNgModuleLoader = (function () {
|
|
|
40
40
|
SystemJsNgModuleLoader.prototype.loadAndCompile = function (path) {
|
|
41
41
|
var _this = this;
|
|
42
42
|
var _a = path.split(_SEPARATOR), module = _a[0], exportName = _a[1];
|
|
43
|
-
if (exportName === undefined)
|
|
43
|
+
if (exportName === undefined) {
|
|
44
44
|
exportName = 'default';
|
|
45
|
+
}
|
|
45
46
|
return System.import(module)
|
|
46
47
|
.then(function (module) { return module[exportName]; })
|
|
47
48
|
.then(function (type) { return checkNotEmpty(type, module, exportName); })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system_js_ng_module_factory_loader.js","sourceRoot":"","sources":["../../../../../modules/@angular/core/src/linker/system_js_ng_module_factory_loader.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;OAGI,EAAC,UAAU,EAAE,QAAQ,EAAC,MAAM,OAAO;OAEnC,EAAC,QAAQ,EAAC,MAAM,YAAY;AAInC,IAAM,UAAU,GAAG,GAAG,CAAC;AAEvB,IAAM,oBAAoB,GAAG,WAAW,CAAC;AAEzC;;;;;GAKG;AACH;IAAA;IAUA,CAAC;IAAD,mCAAC;AAAD,CAAC,AAVD,IAUC;AAED,IAAM,cAAc,GAAiC;IACnD,iBAAiB,EAAE,EAAE;IACrB,iBAAiB,EAAE,YAAY;CAChC,CAAC;AAEF;;;GAGG;AAEH;IAGE,gCAAoB,SAAmB,EAAG,MAAqC;QAA3D,cAAS,GAAT,SAAS,CAAU;QACrC,IAAI,CAAC,OAAO,GAAG,MAAM,IAAI,cAAc,CAAC;IAC1C,CAAC;IAED,qCAAI,GAAJ,UAAK,IAAY;QACf,IAAM,WAAW,GAAG,IAAI,CAAC,SAAS,YAAY,QAAQ,CAAC;QACvD,MAAM,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IAC1E,CAAC;IAEO,+CAAc,GAAtB,UAAuB,IAAY;QAAnC,
|
|
1
|
+
{"version":3,"file":"system_js_ng_module_factory_loader.js","sourceRoot":"","sources":["../../../../../modules/@angular/core/src/linker/system_js_ng_module_factory_loader.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;OAGI,EAAC,UAAU,EAAE,QAAQ,EAAC,MAAM,OAAO;OAEnC,EAAC,QAAQ,EAAC,MAAM,YAAY;AAInC,IAAM,UAAU,GAAG,GAAG,CAAC;AAEvB,IAAM,oBAAoB,GAAG,WAAW,CAAC;AAEzC;;;;;GAKG;AACH;IAAA;IAUA,CAAC;IAAD,mCAAC;AAAD,CAAC,AAVD,IAUC;AAED,IAAM,cAAc,GAAiC;IACnD,iBAAiB,EAAE,EAAE;IACrB,iBAAiB,EAAE,YAAY;CAChC,CAAC;AAEF;;;GAGG;AAEH;IAGE,gCAAoB,SAAmB,EAAG,MAAqC;QAA3D,cAAS,GAAT,SAAS,CAAU;QACrC,IAAI,CAAC,OAAO,GAAG,MAAM,IAAI,cAAc,CAAC;IAC1C,CAAC;IAED,qCAAI,GAAJ,UAAK,IAAY;QACf,IAAM,WAAW,GAAG,IAAI,CAAC,SAAS,YAAY,QAAQ,CAAC;QACvD,MAAM,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IAC1E,CAAC;IAEO,+CAAc,GAAtB,UAAuB,IAAY;QAAnC,iBAUC;QATC,IAAA,2BAAiD,EAA5C,cAAM,EAAE,kBAAU,CAA2B;QAClD,EAAE,CAAC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GAAG;QAClB,EAAC,IAAI,EAAE,4BAA4B,EAAE,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAG,EAAC;KACvE,CAAC;IACF,6BAAC;AAAD,CAAC,AA5CD,IA4CC;AAED,uBAAuB,KAAU,EAAE,UAAkB,EAAE,UAAkB;IACvE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,kBAAgB,UAAU,cAAS,UAAU,MAAG,CAAC,CAAC;IACpE,CAAC;IACD,MAAM,CAAC,KAAK,CAAC;AACf,CAAC","sourcesContent":["/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n\nimport {Injectable, Optional} from '../di';\n\nimport {Compiler} from './compiler';\nimport {NgModuleFactory} from './ng_module_factory';\nimport {NgModuleFactoryLoader} from './ng_module_factory_loader';\n\nconst _SEPARATOR = '#';\n\nconst FACTORY_CLASS_SUFFIX = 'NgFactory';\n\n/**\n * Configuration for SystemJsNgModuleLoader.\n * token.\n *\n * @experimental\n */\nexport abstract class SystemJsNgModuleLoaderConfig {\n /**\n * Prefix to add when computing the name of the factory module for a given module name.\n */\n factoryPathPrefix: string;\n\n /**\n * Suffix to add when computing the name of the factory module for a given module name.\n */\n factoryPathSuffix: string;\n}\n\nconst DEFAULT_CONFIG: SystemJsNgModuleLoaderConfig = {\n factoryPathPrefix: '',\n factoryPathSuffix: '.ngfactory',\n};\n\n/**\n * NgModuleFactoryLoader that uses SystemJS to load NgModuleFactory\n * @experimental\n */\n\nexport class SystemJsNgModuleLoader implements NgModuleFactoryLoader {\n private _config: SystemJsNgModuleLoaderConfig;\n\n constructor(private _compiler: Compiler, config?: SystemJsNgModuleLoaderConfig) {\n this._config = config || DEFAULT_CONFIG;\n }\n\n load(path: string): Promise<NgModuleFactory<any>> {\n const offlineMode = this._compiler instanceof Compiler;\n return offlineMode ? this.loadFactory(path) : this.loadAndCompile(path);\n }\n\n private loadAndCompile(path: string): Promise<NgModuleFactory<any>> {\n let [module, exportName] = path.split(_SEPARATOR);\n if (exportName === undefined) {\n exportName = 'default';\n }\n\n return System.import(module)\n .then((module: any) => module[exportName])\n .then((type: any) => checkNotEmpty(type, module, exportName))\n .then((type: any) => this._compiler.compileModuleAsync(type));\n }\n\n private loadFactory(path: string): Promise<NgModuleFactory<any>> {\n let [module, exportName] = path.split(_SEPARATOR);\n let factoryClassSuffix = FACTORY_CLASS_SUFFIX;\n if (exportName === undefined) {\n exportName = 'default';\n factoryClassSuffix = '';\n }\n\n return System.import(this._config.factoryPathPrefix + module + this._config.factoryPathSuffix)\n .then((module: any) => module[exportName + factoryClassSuffix])\n .then((factory: any) => checkNotEmpty(factory, module, exportName));\n }\nstatic decorators: DecoratorInvocation[] = [\n{ type: Injectable },\n];\n/** @nocollapse */\nstatic ctorParameters: ({type: any, decorators?: DecoratorInvocation[]}|null)[] = [\n{type: Compiler, },\n{type: SystemJsNgModuleLoaderConfig, decorators: [{ type: Optional }, ]},\n];\n}\n\nfunction checkNotEmpty(value: any, modulePath: string, exportName: string): any {\n if (!value) {\n throw new Error(`Cannot find '${exportName}' in '${modulePath}'`);\n }\n return value;\n}\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n"]}
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://angular.io/license
|
|
7
7
|
*/
|
|
8
|
-
import { AppElement } from './element';
|
|
9
8
|
import { ElementRef } from './element_ref';
|
|
9
|
+
import { AppView } from './view';
|
|
10
10
|
import { EmbeddedViewRef } from './view_ref';
|
|
11
11
|
/**
|
|
12
12
|
* Represents an Embedded Template that can be used to instantiate Embedded Views.
|
|
@@ -37,9 +37,10 @@ export declare abstract class TemplateRef<C> {
|
|
|
37
37
|
abstract createEmbeddedView(context: C): EmbeddedViewRef<C>;
|
|
38
38
|
}
|
|
39
39
|
export declare class TemplateRef_<C> extends TemplateRef<C> {
|
|
40
|
-
private
|
|
41
|
-
private
|
|
42
|
-
|
|
40
|
+
private _parentView;
|
|
41
|
+
private _nodeIndex;
|
|
42
|
+
private _nativeElement;
|
|
43
|
+
constructor(_parentView: AppView<any>, _nodeIndex: number, _nativeElement: any);
|
|
43
44
|
createEmbeddedView(context: C): EmbeddedViewRef<C>;
|
|
44
45
|
elementRef: ElementRef;
|
|
45
46
|
}
|
|
@@ -10,6 +10,7 @@ var __extends = (this && this.__extends) || function (d, b) {
|
|
|
10
10
|
function __() { this.constructor = d; }
|
|
11
11
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
12
12
|
};
|
|
13
|
+
import { ElementRef } from './element_ref';
|
|
13
14
|
/**
|
|
14
15
|
* Represents an Embedded Template that can be used to instantiate Embedded Views.
|
|
15
16
|
*
|
|
@@ -47,18 +48,19 @@ export var TemplateRef = (function () {
|
|
|
47
48
|
}());
|
|
48
49
|
export var TemplateRef_ = (function (_super) {
|
|
49
50
|
__extends(TemplateRef_, _super);
|
|
50
|
-
function TemplateRef_(
|
|
51
|
+
function TemplateRef_(_parentView, _nodeIndex, _nativeElement) {
|
|
51
52
|
_super.call(this);
|
|
52
|
-
this.
|
|
53
|
-
this.
|
|
53
|
+
this._parentView = _parentView;
|
|
54
|
+
this._nodeIndex = _nodeIndex;
|
|
55
|
+
this._nativeElement = _nativeElement;
|
|
54
56
|
}
|
|
55
57
|
TemplateRef_.prototype.createEmbeddedView = function (context) {
|
|
56
|
-
var view = this.
|
|
57
|
-
view.create(context || {}
|
|
58
|
+
var view = this._parentView.createEmbeddedViewInternal(this._nodeIndex);
|
|
59
|
+
view.create(context || {});
|
|
58
60
|
return view.ref;
|
|
59
61
|
};
|
|
60
62
|
Object.defineProperty(TemplateRef_.prototype, "elementRef", {
|
|
61
|
-
get: function () { return this.
|
|
63
|
+
get: function () { return new ElementRef(this._nativeElement); },
|
|
62
64
|
enumerable: true,
|
|
63
65
|
configurable: true
|
|
64
66
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template_ref.js","sourceRoot":"","sources":["../../../../../modules/@angular/core/src/linker/template_ref.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;;;;;
|
|
1
|
+
{"version":3,"file":"template_ref.js","sourceRoot":"","sources":["../../../../../modules/@angular/core/src/linker/template_ref.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;;;;;OAEI,EAAC,UAAU,EAAC,MAAM,eAAe;AAMxC;;;;;;;;;;;;GAYG;AACH;IAAA;IAgBA,CAAC;IAHC,sBAAI,mCAAU;QAZd;;;;;;;;;;WAUG;QACH,wCAAwC;aACxC,cAA+B,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;;;OAAA;IAG/C,kBAAC;AAAD,CAAC,AAhBD,IAgBC;AAED;IAAqC,gCAAc;IACjD,sBACY,WAAyB,EAAU,UAAkB,EAAU,cAAmB;QAC5F,iBAAO,CAAC;QADE,gBAAW,GAAX,WAAW,CAAc;QAAU,eAAU,GAAV,UAAU,CAAQ;QAAU,mBAAc,GAAd,cAAc,CAAK;IAE9F,CAAC;IAED,yCAAkB,GAAlB,UAAmB,OAAU;QAC3B,IAAM,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,0BAA0B,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC1E,IAAI,CAAC,MAAM,CAAC,OAAO,IAAS,EAAE,CAAC,CAAC;QAChC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;IAClB,CAAC;IAED,sBAAI,oCAAU;aAAd,cAA+B,MAAM,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;;;OAAA;IAC9E,mBAAC;AAAD,CAAC,AAbD,CAAqC,WAAW,GAa/C","sourcesContent":["/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ElementRef} from './element_ref';\nimport {AppView} from './view';\nimport {ViewContainer} from './view_container';\nimport {EmbeddedViewRef} from './view_ref';\n\n\n/**\n * Represents an Embedded Template that can be used to instantiate Embedded Views.\n *\n * You can access a `TemplateRef`, in two ways. Via a directive placed on a `<template>` element (or\n * directive prefixed with `*`) and have the `TemplateRef` for this Embedded View injected into the\n * constructor of the directive using the `TemplateRef` Token. Alternatively you can query for the\n * `TemplateRef` from a Component or a Directive via {@link Query}.\n *\n * To instantiate Embedded Views based on a Template, use\n * {@link ViewContainerRef#createEmbeddedView}, which will create the View and attach it to the\n * View Container.\n * @stable\n */\nexport abstract class TemplateRef<C> {\n /**\n * The location in the View where the Embedded View logically belongs to.\n *\n * The data-binding and injection contexts of Embedded Views created from this `TemplateRef`\n * inherit from the contexts of this location.\n *\n * Typically new Embedded Views are attached to the View Container of this location, but in\n * advanced use-cases, the View can be attached to a different container while keeping the\n * data-binding and injection context from the original location.\n *\n */\n // TODO(i): rename to anchor or location\n get elementRef(): ElementRef { return null; }\n\n abstract createEmbeddedView(context: C): EmbeddedViewRef<C>;\n}\n\nexport class TemplateRef_<C> extends TemplateRef<C> {\n constructor(\n private _parentView: AppView<any>, private _nodeIndex: number, private _nativeElement: any) {\n super();\n }\n\n createEmbeddedView(context: C): EmbeddedViewRef<C> {\n const view = this._parentView.createEmbeddedViewInternal(this._nodeIndex);\n view.create(context || <any>{});\n return view.ref;\n }\n\n get elementRef(): ElementRef { return new ElementRef(this._nativeElement); }\n}\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n"]}
|
package/src/linker/view.d.ts
CHANGED
|
@@ -9,8 +9,9 @@ import { ChangeDetectorRef, ChangeDetectorStatus } from '../change_detection/cha
|
|
|
9
9
|
import { Injector } from '../di/injector';
|
|
10
10
|
import { RenderComponentType, Renderer } from '../render/api';
|
|
11
11
|
import { AnimationViewContext } from './animation_view_context';
|
|
12
|
+
import { ComponentRef } from './component_factory';
|
|
12
13
|
import { DebugContext, StaticNodeDebugInfo } from './debug_context';
|
|
13
|
-
import {
|
|
14
|
+
import { ViewContainer } from './view_container';
|
|
14
15
|
import { ViewRef_ } from './view_ref';
|
|
15
16
|
import { ViewType } from './view_type';
|
|
16
17
|
import { ViewUtils } from './view_utils';
|
|
@@ -23,30 +24,40 @@ export declare abstract class AppView<T> {
|
|
|
23
24
|
componentType: RenderComponentType;
|
|
24
25
|
type: ViewType;
|
|
25
26
|
viewUtils: ViewUtils;
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
parentView: AppView<any>;
|
|
28
|
+
parentIndex: number;
|
|
29
|
+
parentElement: any;
|
|
28
30
|
cdMode: ChangeDetectorStatus;
|
|
31
|
+
declaredViewContainer: ViewContainer;
|
|
29
32
|
ref: ViewRef_<T>;
|
|
30
33
|
lastRootNode: any;
|
|
31
34
|
allNodes: any[];
|
|
32
35
|
disposables: Function[];
|
|
33
|
-
|
|
36
|
+
viewContainer: ViewContainer;
|
|
34
37
|
numberOfChecks: number;
|
|
35
38
|
renderer: Renderer;
|
|
36
39
|
private _hasExternalHostElement;
|
|
40
|
+
private _hostInjector;
|
|
41
|
+
private _hostProjectableNodes;
|
|
37
42
|
private _animationContext;
|
|
43
|
+
private _directRenderer;
|
|
38
44
|
context: T;
|
|
39
|
-
constructor(clazz: any, componentType: RenderComponentType, type: ViewType, viewUtils: ViewUtils,
|
|
45
|
+
constructor(clazz: any, componentType: RenderComponentType, type: ViewType, viewUtils: ViewUtils, parentView: AppView<any>, parentIndex: number, parentElement: any, cdMode: ChangeDetectorStatus, declaredViewContainer?: ViewContainer);
|
|
40
46
|
animationContext: AnimationViewContext;
|
|
41
47
|
destroyed: boolean;
|
|
42
|
-
create(context: T
|
|
48
|
+
create(context: T): ComponentRef<any>;
|
|
49
|
+
createHostView(rootSelectorOrNode: string | any, hostInjector: Injector, projectableNodes: any[][]): ComponentRef<any>;
|
|
43
50
|
/**
|
|
44
51
|
* Overwritten by implementations.
|
|
45
|
-
* Returns the
|
|
52
|
+
* Returns the ComponentRef for the host element for ViewType.HOST.
|
|
46
53
|
*/
|
|
47
|
-
createInternal(rootSelectorOrNode: string | any):
|
|
54
|
+
createInternal(rootSelectorOrNode: string | any): ComponentRef<any>;
|
|
55
|
+
/**
|
|
56
|
+
* Overwritten by implementations.
|
|
57
|
+
*/
|
|
58
|
+
createEmbeddedViewInternal(templateNodeIndex: number): AppView<any>;
|
|
48
59
|
init(lastRootNode: any, allNodes: any[], disposables: Function[]): void;
|
|
49
|
-
injectorGet(token: any, nodeIndex: number,
|
|
60
|
+
injectorGet(token: any, nodeIndex: number, notFoundValue?: any): any;
|
|
50
61
|
/**
|
|
51
62
|
* Overwritten by implementations
|
|
52
63
|
*/
|
|
@@ -63,10 +74,13 @@ export declare abstract class AppView<T> {
|
|
|
63
74
|
*/
|
|
64
75
|
detachInternal(): void;
|
|
65
76
|
detach(): void;
|
|
77
|
+
private _renderDetach();
|
|
78
|
+
attachAfter(viewContainer: ViewContainer, prevView: AppView<any>): void;
|
|
79
|
+
moveAfter(viewContainer: ViewContainer, prevView: AppView<any>): void;
|
|
80
|
+
private _renderAttach(viewContainer, prevView);
|
|
66
81
|
changeDetectorRef: ChangeDetectorRef;
|
|
67
|
-
parent: AppView<any>;
|
|
68
82
|
flatRootNodes: any[];
|
|
69
|
-
|
|
83
|
+
projectNodes(parentElement: any, ngContentIndex: number): void;
|
|
70
84
|
visitProjectedNodes<C>(ngContentIndex: number, cb: (node: any, ctx: C) => void, c: C): void;
|
|
71
85
|
/**
|
|
72
86
|
* Overwritten by implementations
|
|
@@ -85,9 +99,6 @@ export declare abstract class AppView<T> {
|
|
|
85
99
|
* Overwritten by implementations
|
|
86
100
|
*/
|
|
87
101
|
detectChangesInternal(throwOnChange: boolean): void;
|
|
88
|
-
markContentChildAsMoved(renderAppElement: AppElement): void;
|
|
89
|
-
addToContentChildren(renderAppElement: AppElement): void;
|
|
90
|
-
removeFromContentChildren(renderAppElement: AppElement): void;
|
|
91
102
|
markAsCheckOnce(): void;
|
|
92
103
|
markPathToRootAsCheckOnce(): void;
|
|
93
104
|
eventHandler<E, R>(cb: (eventName: string, event?: E) => R): (eventName: string, event?: E) => R;
|
|
@@ -96,9 +107,10 @@ export declare abstract class AppView<T> {
|
|
|
96
107
|
export declare class DebugAppView<T> extends AppView<T> {
|
|
97
108
|
staticNodeDebugInfos: StaticNodeDebugInfo[];
|
|
98
109
|
private _currentDebugContext;
|
|
99
|
-
constructor(clazz: any, componentType: RenderComponentType, type: ViewType, viewUtils: ViewUtils,
|
|
100
|
-
create(context: T
|
|
101
|
-
|
|
110
|
+
constructor(clazz: any, componentType: RenderComponentType, type: ViewType, viewUtils: ViewUtils, parentView: AppView<any>, parentIndex: number, parentNode: any, cdMode: ChangeDetectorStatus, staticNodeDebugInfos: StaticNodeDebugInfo[], declaredViewContainer?: ViewContainer);
|
|
111
|
+
create(context: T): ComponentRef<any>;
|
|
112
|
+
createHostView(rootSelectorOrNode: string | any, injector: Injector, projectableNodes?: any[][]): ComponentRef<any>;
|
|
113
|
+
injectorGet(token: any, nodeIndex: number, notFoundResult?: any): any;
|
|
102
114
|
detach(): void;
|
|
103
115
|
destroy(): void;
|
|
104
116
|
detectChanges(throwOnChange: boolean): void;
|