@angular/platform-browser-dynamic 2.0.0-rc.1 → 2.0.0-rc.2
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/{platform-browser-dynamic.umd.js → bundles/platform-browser-dynamic.umd.js} +107 -65
- package/bundles/platform-browser-dynamic.umd.min.js +1 -0
- package/core_private.d.ts +1 -1
- package/core_private.js +1 -0
- package/core_private.js.map +1 -1
- package/core_private.metadata.json +1 -1
- package/esm/core_private.d.ts +1 -1
- package/esm/core_private.js +1 -0
- package/esm/core_private.js.map +1 -1
- package/esm/core_private.metadata.json +1 -1
- package/esm/index.d.ts +74 -1
- package/esm/index.js +129 -1
- package/esm/index.js.map +1 -1
- package/esm/index.metadata.json +1 -0
- package/esm/platform_browser_private.d.ts +2 -3
- package/esm/platform_browser_private.js +2 -3
- package/esm/platform_browser_private.js.map +1 -1
- package/esm/platform_browser_private.metadata.json +1 -0
- package/esm/private_export_testing.d.ts +8 -0
- package/esm/private_export_testing.js +5 -0
- package/esm/private_export_testing.js.map +1 -0
- package/esm/private_export_testing.metadata.json +1 -0
- package/esm/src/facade/async.d.ts +90 -0
- package/esm/src/facade/async.js +137 -0
- package/esm/src/facade/async.js.map +1 -0
- package/esm/src/facade/base_wrapped_exception.js +4 -4
- package/esm/src/facade/base_wrapped_exception.js.map +1 -1
- package/esm/src/facade/collection.js +1 -1
- package/esm/src/facade/collection.js.map +1 -1
- package/esm/src/facade/collection.metadata.json +1 -1
- package/esm/src/facade/exception_handler.d.ts +2 -11
- package/esm/src/facade/exception_handler.js +8 -7
- package/esm/src/facade/exception_handler.js.map +1 -1
- package/esm/src/facade/exceptions.d.ts +4 -0
- package/esm/src/facade/exceptions.js +6 -2
- package/esm/src/facade/exceptions.js.map +1 -1
- package/esm/src/facade/exceptions.metadata.json +1 -0
- package/esm/src/facade/lang.d.ts +6 -4
- package/esm/src/facade/lang.js +12 -11
- package/esm/src/facade/lang.js.map +1 -1
- package/esm/src/facade/lang.metadata.json +1 -1
- package/esm/src/facade/promise.js.map +1 -1
- package/esm/src/xhr/xhr_cache.js +3 -3
- package/esm/src/xhr/xhr_cache.js.map +1 -1
- package/esm/src/xhr/xhr_impl.js +2 -2
- package/esm/src/xhr/xhr_impl.js.map +1 -1
- package/esm/testing/dom_test_component_renderer.d.ts +9 -0
- package/esm/testing/dom_test_component_renderer.js +29 -0
- package/esm/testing/dom_test_component_renderer.js.map +1 -0
- package/esm/testing/dom_test_component_renderer.metadata.json +1 -0
- package/esm/testing.d.ts +9 -1
- package/esm/testing.js +22 -1
- package/esm/testing.js.map +1 -1
- package/esm/testing.metadata.json +1 -0
- package/index.d.ts +74 -1
- package/index.js +131 -3
- package/index.js.map +1 -1
- package/index.metadata.json +1 -0
- package/package.json +5 -5
- package/platform_browser_private.d.ts +2 -3
- package/platform_browser_private.js +1 -3
- package/platform_browser_private.js.map +1 -1
- package/platform_browser_private.metadata.json +1 -0
- package/private_export_testing.d.ts +8 -0
- package/private_export_testing.js +6 -0
- package/private_export_testing.js.map +1 -0
- package/private_export_testing.metadata.json +1 -0
- package/src/facade/async.d.ts +90 -0
- package/src/facade/async.js +160 -0
- package/src/facade/async.js.map +1 -0
- package/src/facade/base_wrapped_exception.js +4 -4
- package/src/facade/base_wrapped_exception.js.map +1 -1
- package/src/facade/collection.js.map +1 -1
- package/src/facade/collection.metadata.json +1 -1
- package/src/facade/exception_handler.d.ts +2 -11
- package/src/facade/exception_handler.js +8 -7
- package/src/facade/exception_handler.js.map +1 -1
- package/src/facade/exceptions.d.ts +4 -0
- package/src/facade/exceptions.js +6 -2
- package/src/facade/exceptions.js.map +1 -1
- package/src/facade/exceptions.metadata.json +1 -0
- package/src/facade/lang.d.ts +6 -4
- package/src/facade/lang.js +12 -11
- package/src/facade/lang.js.map +1 -1
- package/src/facade/lang.metadata.json +1 -1
- package/src/facade/promise.js.map +1 -1
- package/src/xhr/xhr_cache.js +3 -3
- package/src/xhr/xhr_cache.js.map +1 -1
- package/src/xhr/xhr_impl.js +2 -2
- package/src/xhr/xhr_impl.js.map +1 -1
- package/testing/dom_test_component_renderer.d.ts +9 -0
- package/testing/dom_test_component_renderer.js +38 -0
- package/testing/dom_test_component_renderer.js.map +1 -0
- package/testing/dom_test_component_renderer.metadata.json +1 -0
- package/testing.d.ts +9 -1
- package/testing.js +22 -1
- package/testing.js.map +1 -1
- package/testing.metadata.json +1 -0
- package/esm/platform_browser_dynamic.d.ts +0 -75
- package/esm/platform_browser_dynamic.js +0 -92
- package/esm/platform_browser_dynamic.js.map +0 -1
- package/esm/platform_browser_dynamic.metadata.json +0 -1
- package/esm/testing/browser.d.ts +0 -8
- package/esm/testing/browser.js +0 -13
- package/esm/testing/browser.js.map +0 -1
- package/esm/testing/browser.metadata.json +0 -1
- package/platform_browser_dynamic.d.ts +0 -75
- package/platform_browser_dynamic.js +0 -94
- package/platform_browser_dynamic.js.map +0 -1
- package/platform_browser_dynamic.metadata.json +0 -1
- package/testing/browser.d.ts +0 -8
- package/testing/browser.js +0 -14
- package/testing/browser.js.map +0 -1
- package/testing/browser.metadata.json +0 -1
package/index.js
CHANGED
|
@@ -1,6 +1,134 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
var common_1 = require('@angular/common');
|
|
3
|
+
var compiler_1 = require('@angular/compiler');
|
|
4
|
+
var core_1 = require('@angular/core');
|
|
5
|
+
var platform_browser_1 = require('@angular/platform-browser');
|
|
6
|
+
var core_private_1 = require('./core_private');
|
|
7
|
+
var async_1 = require('./src/facade/async');
|
|
8
|
+
var lang_1 = require('./src/facade/lang');
|
|
9
|
+
var xhr_cache_1 = require('./src/xhr/xhr_cache');
|
|
10
|
+
var xhr_impl_1 = require('./src/xhr/xhr_impl');
|
|
11
|
+
exports.BROWSER_APP_COMPILER_PROVIDERS = [
|
|
12
|
+
compiler_1.COMPILER_PROVIDERS, {
|
|
13
|
+
provide: compiler_1.CompilerConfig,
|
|
14
|
+
useFactory: function (platformDirectives, platformPipes) {
|
|
15
|
+
return new compiler_1.CompilerConfig({ platformDirectives: platformDirectives, platformPipes: platformPipes });
|
|
16
|
+
},
|
|
17
|
+
deps: [core_1.PLATFORM_DIRECTIVES, core_1.PLATFORM_PIPES]
|
|
18
|
+
},
|
|
19
|
+
{ provide: compiler_1.XHR, useClass: xhr_impl_1.XHRImpl },
|
|
20
|
+
{ provide: core_1.PLATFORM_DIRECTIVES, useValue: common_1.COMMON_DIRECTIVES, multi: true },
|
|
21
|
+
{ provide: core_1.PLATFORM_PIPES, useValue: common_1.COMMON_PIPES, multi: true }
|
|
22
|
+
];
|
|
23
|
+
exports.CACHED_TEMPLATE_PROVIDER = [{ provide: compiler_1.XHR, useClass: xhr_cache_1.CachedXHR }];
|
|
24
|
+
/**
|
|
25
|
+
* Bootstrapping for Angular applications.
|
|
26
|
+
*
|
|
27
|
+
* You instantiate an Angular application by explicitly specifying a component to use
|
|
28
|
+
* as the root component for your application via the `bootstrap()` method.
|
|
29
|
+
*
|
|
30
|
+
* ## Simple Example
|
|
31
|
+
*
|
|
32
|
+
* Assuming this `index.html`:
|
|
33
|
+
*
|
|
34
|
+
* ```html
|
|
35
|
+
* <html>
|
|
36
|
+
* <!-- load Angular script tags here. -->
|
|
37
|
+
* <body>
|
|
38
|
+
* <my-app>loading...</my-app>
|
|
39
|
+
* </body>
|
|
40
|
+
* </html>
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* An application is bootstrapped inside an existing browser DOM, typically `index.html`.
|
|
44
|
+
* Unlike Angular 1, Angular 2 does not compile/process providers in `index.html`. This is
|
|
45
|
+
* mainly for security reasons, as well as architectural changes in Angular 2. This means
|
|
46
|
+
* that `index.html` can safely be processed using server-side technologies such as
|
|
47
|
+
* providers. Bindings can thus use double-curly `{{ syntax }}` without collision from
|
|
48
|
+
* Angular 2 component double-curly `{{ syntax }}`.
|
|
49
|
+
*
|
|
50
|
+
* We can use this script code:
|
|
51
|
+
*
|
|
52
|
+
* {@example core/ts/bootstrap/bootstrap.ts region='bootstrap'}
|
|
53
|
+
*
|
|
54
|
+
* When the app developer invokes `bootstrap()` with the root component `MyApp` as its
|
|
55
|
+
* argument, Angular performs the following tasks:
|
|
56
|
+
*
|
|
57
|
+
* 1. It uses the component's `selector` property to locate the DOM element which needs
|
|
58
|
+
* to be upgraded into the angular component.
|
|
59
|
+
* 2. It creates a new child injector (from the platform injector). Optionally, you can
|
|
60
|
+
* also override the injector configuration for an app by invoking `bootstrap` with the
|
|
61
|
+
* `componentInjectableBindings` argument.
|
|
62
|
+
* 3. It creates a new `Zone` and connects it to the angular application's change detection
|
|
63
|
+
* domain instance.
|
|
64
|
+
* 4. It creates an emulated or shadow DOM on the selected component's host element and loads the
|
|
65
|
+
* template into it.
|
|
66
|
+
* 5. It instantiates the specified component.
|
|
67
|
+
* 6. Finally, Angular performs change detection to apply the initial data providers for the
|
|
68
|
+
* application.
|
|
69
|
+
*
|
|
70
|
+
*
|
|
71
|
+
* ## Bootstrapping Multiple Applications
|
|
72
|
+
*
|
|
73
|
+
* When working within a browser window, there are many singleton resources: cookies, title,
|
|
74
|
+
* location, and others. Angular services that represent these resources must likewise be
|
|
75
|
+
* shared across all Angular applications that occupy the same browser window. For this
|
|
76
|
+
* reason, Angular creates exactly one global platform object which stores all shared
|
|
77
|
+
* services, and each angular application injector has the platform injector as its parent.
|
|
78
|
+
*
|
|
79
|
+
* Each application has its own private injector as well. When there are multiple
|
|
80
|
+
* applications on a page, Angular treats each application injector's services as private
|
|
81
|
+
* to that application.
|
|
82
|
+
*
|
|
83
|
+
* ## API
|
|
84
|
+
*
|
|
85
|
+
* - `appComponentType`: The root component which should act as the application. This is
|
|
86
|
+
* a reference to a `Type` which is annotated with `@Component(...)`.
|
|
87
|
+
* - `customProviders`: An additional set of providers that can be added to the
|
|
88
|
+
* app injector to override default injection behavior.
|
|
89
|
+
*
|
|
90
|
+
* Returns a `Promise` of {@link ComponentRef}.
|
|
91
|
+
*/
|
|
92
|
+
function bootstrap(appComponentType, customProviders) {
|
|
93
|
+
core_private_1.reflector.reflectionCapabilities = new core_private_1.ReflectionCapabilities();
|
|
94
|
+
var providers = [
|
|
95
|
+
platform_browser_1.BROWSER_APP_PROVIDERS, exports.BROWSER_APP_COMPILER_PROVIDERS,
|
|
96
|
+
lang_1.isPresent(customProviders) ? customProviders : []
|
|
97
|
+
];
|
|
98
|
+
var appInjector = core_1.ReflectiveInjector.resolveAndCreate(providers, platform_browser_1.browserPlatform().injector);
|
|
99
|
+
return core_1.coreLoadAndBootstrap(appComponentType, appInjector);
|
|
4
100
|
}
|
|
5
|
-
|
|
101
|
+
exports.bootstrap = bootstrap;
|
|
102
|
+
function bootstrapWorkerUi(workerScriptUri, customProviders) {
|
|
103
|
+
var app = core_1.ReflectiveInjector.resolveAndCreate([
|
|
104
|
+
platform_browser_1.WORKER_UI_APPLICATION_PROVIDERS, exports.BROWSER_APP_COMPILER_PROVIDERS,
|
|
105
|
+
{ provide: platform_browser_1.WORKER_SCRIPT, useValue: workerScriptUri },
|
|
106
|
+
lang_1.isPresent(customProviders) ? customProviders : []
|
|
107
|
+
], platform_browser_1.workerUiPlatform().injector);
|
|
108
|
+
// Return a promise so that we keep the same semantics as Dart,
|
|
109
|
+
// and we might want to wait for the app side to come up
|
|
110
|
+
// in the future...
|
|
111
|
+
return async_1.PromiseWrapper.resolve(app.get(core_1.ApplicationRef));
|
|
112
|
+
}
|
|
113
|
+
exports.bootstrapWorkerUi = bootstrapWorkerUi;
|
|
114
|
+
var WORKER_APP_COMPILER_PROVIDERS = [
|
|
115
|
+
compiler_1.COMPILER_PROVIDERS, {
|
|
116
|
+
provide: compiler_1.CompilerConfig,
|
|
117
|
+
useFactory: function (platformDirectives, platformPipes) {
|
|
118
|
+
return new compiler_1.CompilerConfig({ platformDirectives: platformDirectives, platformPipes: platformPipes });
|
|
119
|
+
},
|
|
120
|
+
deps: [core_1.PLATFORM_DIRECTIVES, core_1.PLATFORM_PIPES]
|
|
121
|
+
},
|
|
122
|
+
{ provide: compiler_1.XHR, useClass: xhr_impl_1.XHRImpl },
|
|
123
|
+
{ provide: core_1.PLATFORM_DIRECTIVES, useValue: common_1.COMMON_DIRECTIVES, multi: true },
|
|
124
|
+
{ provide: core_1.PLATFORM_PIPES, useValue: common_1.COMMON_PIPES, multi: true }
|
|
125
|
+
];
|
|
126
|
+
function bootstrapWorkerApp(appComponentType, customProviders) {
|
|
127
|
+
var appInjector = core_1.ReflectiveInjector.resolveAndCreate([
|
|
128
|
+
platform_browser_1.WORKER_APP_APPLICATION_PROVIDERS, WORKER_APP_COMPILER_PROVIDERS,
|
|
129
|
+
lang_1.isPresent(customProviders) ? customProviders : []
|
|
130
|
+
], platform_browser_1.workerAppPlatform().injector);
|
|
131
|
+
return core_1.coreLoadAndBootstrap(appComponentType, appInjector);
|
|
132
|
+
}
|
|
133
|
+
exports.bootstrapWorkerApp = bootstrapWorkerApp;
|
|
6
134
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../modules/@angular/platform-browser-dynamic/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../modules/@angular/platform-browser-dynamic/index.ts"],"names":[],"mappings":";AAAA,uBAA8C,iBAAiB,CAAC,CAAA;AAChE,yBAAsD,mBAAmB,CAAC,CAAA;AAC1E,qBAAgI,eAAe,CAAC,CAAA;AAChJ,iCAA4K,2BAA2B,CAAC,CAAA;AAExM,6BAAgD,gBAAgB,CAAC,CAAA;AACjE,sBAA6B,oBAAoB,CAAC,CAAA;AAClD,qBAAwB,mBAAmB,CAAC,CAAA;AAC5C,0BAAwB,qBAAqB,CAAC,CAAA;AAC9C,yBAAsB,oBAAoB,CAAC,CAAA;AAG9B,sCAA8B,GAA2C;IACpF,6BAAkB,EAAE;QAClB,OAAO,EAAE,yBAAc;QACvB,UAAU,EAAE,UAAC,kBAAyB,E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compiler';\nimport {ApplicationRef, ComponentRef, PLATFORM_DIRECTIVES, PLATFORM_PIPES, ReflectiveInjector, Type, coreLoadAndBootstrap} from '@angular/core';\nimport {BROWSER_APP_PROVIDERS, WORKER_APP_APPLICATION_PROVIDERS, WORKER_SCRIPT, WORKER_UI_APPLICATION_PROVIDERS, browserPlatform, workerAppPlatform, workerUiPlatform} from '@angular/platform-browser';\n\nimport {ReflectionCapabilities, reflector} from './core_private';\nimport {PromiseWrapper} from './src/facade/async';\nimport {isPresent} from './src/facade/lang';\nimport {CachedXHR} from './src/xhr/xhr_cache';\nimport {XHRImpl} from './src/xhr/xhr_impl';\n\n\nexport const BROWSER_APP_COMPILER_PROVIDERS: Array<any /*Type | Provider | any[]*/> = [\n COMPILER_PROVIDERS, {\n provide: CompilerConfig,\n useFactory: (platformDirectives: any[], platformPipes: any[]) => {\n return new CompilerConfig({platformDirectives, platformPipes});\n },\n deps: [PLATFORM_DIRECTIVES, PLATFORM_PIPES]\n },\n {provide: XHR, useClass: XHRImpl},\n {provide: PLATFORM_DIRECTIVES, useValue: COMMON_DIRECTIVES, multi: true},\n {provide: PLATFORM_PIPES, useValue: COMMON_PIPES, multi: true}\n];\n\n\nexport const CACHED_TEMPLATE_PROVIDER: Array<any /*Type | Provider | any[]*/> =\n [{provide: XHR, useClass: CachedXHR}];\n\n\n\n/**\n * Bootstrapping for Angular applications.\n *\n * You instantiate an Angular application by explicitly specifying a component to use\n * as the root component for your application via the `bootstrap()` method.\n *\n * ## Simple Example\n *\n * Assuming this `index.html`:\n *\n * ```html\n * <html>\n * <!-- load Angular script tags here. -->\n * <body>\n * <my-app>loading...</my-app>\n * </body>\n * </html>\n * ```\n *\n * An application is bootstrapped inside an existing browser DOM, typically `index.html`.\n * Unlike Angular 1, Angular 2 does not compile/process providers in `index.html`. This is\n * mainly for security reasons, as well as architectural changes in Angular 2. This means\n * that `index.html` can safely be processed using server-side technologies such as\n * providers. Bindings can thus use double-curly `{{ syntax }}` without collision from\n * Angular 2 component double-curly `{{ syntax }}`.\n *\n * We can use this script code:\n *\n * {@example core/ts/bootstrap/bootstrap.ts region='bootstrap'}\n *\n * When the app developer invokes `bootstrap()` with the root component `MyApp` as its\n * argument, Angular performs the following tasks:\n *\n * 1. It uses the component's `selector` property to locate the DOM element which needs\n * to be upgraded into the angular component.\n * 2. It creates a new child injector (from the platform injector). Optionally, you can\n * also override the injector configuration for an app by invoking `bootstrap` with the\n * `componentInjectableBindings` argument.\n * 3. It creates a new `Zone` and connects it to the angular application's change detection\n * domain instance.\n * 4. It creates an emulated or shadow DOM on the selected component's host element and loads the\n * template into it.\n * 5. It instantiates the specified component.\n * 6. Finally, Angular performs change detection to apply the initial data providers for the\n * application.\n *\n *\n * ## Bootstrapping Multiple Applications\n *\n * When working within a browser window, there are many singleton resources: cookies, title,\n * location, and others. Angular services that represent these resources must likewise be\n * shared across all Angular applications that occupy the same browser window. For this\n * reason, Angular creates exactly one global platform object which stores all shared\n * services, and each angular application injector has the platform injector as its parent.\n *\n * Each application has its own private injector as well. When there are multiple\n * applications on a page, Angular treats each application injector's services as private\n * to that application.\n *\n * ## API\n *\n * - `appComponentType`: The root component which should act as the application. This is\n * a reference to a `Type` which is annotated with `@Component(...)`.\n * - `customProviders`: An additional set of providers that can be added to the\n * app injector to override default injection behavior.\n *\n * Returns a `Promise` of {@link ComponentRef}.\n */\nexport function bootstrap(\n appComponentType: Type,\n customProviders?: Array<any /*Type | Provider | any[]*/>): Promise<ComponentRef<any>> {\n reflector.reflectionCapabilities = new ReflectionCapabilities();\n let providers = [\n BROWSER_APP_PROVIDERS, BROWSER_APP_COMPILER_PROVIDERS,\n isPresent(customProviders) ? customProviders : []\n ];\n var appInjector = ReflectiveInjector.resolveAndCreate(providers, browserPlatform().injector);\n return coreLoadAndBootstrap(appComponentType, appInjector);\n}\n\n\nexport function bootstrapWorkerUi(\n workerScriptUri: string,\n customProviders?: Array<any /*Type | Provider | any[]*/>): Promise<ApplicationRef> {\n var app = ReflectiveInjector.resolveAndCreate(\n [\n WORKER_UI_APPLICATION_PROVIDERS, BROWSER_APP_COMPILER_PROVIDERS,\n {provide: WORKER_SCRIPT, useValue: workerScriptUri},\n isPresent(customProviders) ? customProviders : []\n ],\n workerUiPlatform().injector);\n // Return a promise so that we keep the same semantics as Dart,\n // and we might want to wait for the app side to come up\n // in the future...\n return PromiseWrapper.resolve(app.get(ApplicationRef));\n}\n\n\nconst WORKER_APP_COMPILER_PROVIDERS: Array<any /*Type | Provider | any[]*/> = [\n COMPILER_PROVIDERS, {\n provide: CompilerConfig,\n useFactory: (platformDirectives: any[], platformPipes: any[]) => {\n return new CompilerConfig({platformDirectives, platformPipes});\n },\n deps: [PLATFORM_DIRECTIVES, PLATFORM_PIPES]\n },\n {provide: XHR, useClass: XHRImpl},\n {provide: PLATFORM_DIRECTIVES, useValue: COMMON_DIRECTIVES, multi: true},\n {provide: PLATFORM_PIPES, useValue: COMMON_PIPES, multi: true}\n];\n\n\nexport function bootstrapWorkerApp(\n appComponentType: Type,\n customProviders?: Array<any /*Type | Provider | any[]*/>): Promise<ComponentRef<any>> {\n var appInjector = ReflectiveInjector.resolveAndCreate(\n [\n WORKER_APP_APPLICATION_PROVIDERS, WORKER_APP_COMPILER_PROVIDERS,\n isPresent(customProviders) ? customProviders : []\n ],\n workerAppPlatform().injector);\n return coreLoadAndBootstrap(appComponentType, appInjector);\n}\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"__symbolic":"module","version":1,"metadata":{"BROWSER_APP_COMPILER_PROVIDERS":{"__symbolic":"error","message":"Function call not supported","line":15,"character":15},"CACHED_TEMPLATE_PROVIDER":[{"provide":{"__symbolic":"reference","module":"@angular/compiler","name":"XHR"},"useClass":{"__symbolic":"reference","module":"./src/xhr/xhr_cache","name":"CachedXHR"}}]}}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular/platform-browser-dynamic",
|
|
3
|
-
"version": "2.0.0-rc.
|
|
3
|
+
"version": "2.0.0-rc.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"jsnext:main": "esm/index.js",
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
"author": "angular",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"peerDependencies": {
|
|
11
|
-
"@angular/core": "2.0.0-rc.
|
|
12
|
-
"@angular/common": "2.0.0-rc.
|
|
13
|
-
"@angular/compiler": "2.0.0-rc.
|
|
14
|
-
"@angular/platform-browser": "2.0.0-rc.
|
|
11
|
+
"@angular/core": "2.0.0-rc.2",
|
|
12
|
+
"@angular/common": "2.0.0-rc.2",
|
|
13
|
+
"@angular/compiler": "2.0.0-rc.2",
|
|
14
|
+
"@angular/platform-browser": "2.0.0-rc.2"
|
|
15
15
|
}
|
|
16
16
|
}
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import { __platform_browser_private__ as
|
|
2
|
-
export declare
|
|
3
|
-
export declare function getDOM(): _.DomAdapter;
|
|
1
|
+
import { __platform_browser_private__ as t } from '@angular/platform-browser';
|
|
2
|
+
export declare var getDOM: typeof t.getDOM;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var platform_browser_1 = require('@angular/platform-browser');
|
|
3
|
-
|
|
4
|
-
exports.getDOM = getDOM;
|
|
5
|
-
;
|
|
3
|
+
exports.getDOM = platform_browser_1.__platform_browser_private__.getDOM;
|
|
6
4
|
//# sourceMappingURL=platform_browser_private.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform_browser_private.js","sourceRoot":"","sources":["../../../modules/@angular/platform-browser-dynamic/platform_browser_private.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"platform_browser_private.js","sourceRoot":"","sources":["../../../modules/@angular/platform-browser-dynamic/platform_browser_private.ts"],"names":[],"mappings":";AAAA,iCAAmF,2BAA2B,CAAC,CAAA;AAEpG,cAAM,GAAoB,+CAAC,CAAC,MAAM,CAAC","sourcesContent":["import {__platform_browser_private__ as r, __platform_browser_private__ as t} from '@angular/platform-browser';\n\nexport var getDOM: typeof t.getDOM = r.getDOM;\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"__symbolic":"module","version":1,"metadata":{"getDOM":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/platform-browser","name":"___platform_browser_private__"},"member":"getDOM"}}}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as testing from './testing/dom_test_component_renderer';
|
|
2
|
+
export declare namespace __platform_browser_dynamic_private_types__ {
|
|
3
|
+
type DOMTestComponentRenderer = testing.DOMTestComponentRenderer;
|
|
4
|
+
var DOMTestComponentRenderer: typeof testing.DOMTestComponentRenderer;
|
|
5
|
+
}
|
|
6
|
+
export declare var __platform_browser_dynamic_private__: {
|
|
7
|
+
DOMTestComponentRenderer: typeof testing.DOMTestComponentRenderer;
|
|
8
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"private_export_testing.js","sourceRoot":"","sources":["../../../modules/@angular/platform-browser-dynamic/private_export_testing.ts"],"names":[],"mappings":";AAAA,IAAY,OAAO,WAAM,uCAAuC,CAAC,CAAA;AAOtD,4CAAoC,GAAG;IAChD,wBAAwB,EAAE,OAAO,CAAC,wBAAwB;CAC3D,CAAC","sourcesContent":["import * as testing from './testing/dom_test_component_renderer';\n\nexport declare namespace __platform_browser_dynamic_private_types__ {\n export type DOMTestComponentRenderer = testing.DOMTestComponentRenderer;\n export var DOMTestComponentRenderer: typeof testing.DOMTestComponentRenderer;\n}\n\nexport var __platform_browser_dynamic_private__ = {\n DOMTestComponentRenderer: testing.DOMTestComponentRenderer\n};\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"__symbolic":"module","version":1,"metadata":{"___platform_browser_dynamic_private__":{"DOMTestComponentRenderer":{"__symbolic":"reference","module":"./testing/dom_test_component_renderer","name":"DOMTestComponentRenderer"}}}}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { Observable } from 'rxjs/Observable';
|
|
2
|
+
import { Subject } from 'rxjs/Subject';
|
|
3
|
+
export { Observable } from 'rxjs/Observable';
|
|
4
|
+
export { Subject } from 'rxjs/Subject';
|
|
5
|
+
export { PromiseCompleter, PromiseWrapper } from './promise';
|
|
6
|
+
export declare class TimerWrapper {
|
|
7
|
+
static setTimeout(fn: (...args: any[]) => void, millis: number): number;
|
|
8
|
+
static clearTimeout(id: number): void;
|
|
9
|
+
static setInterval(fn: (...args: any[]) => void, millis: number): number;
|
|
10
|
+
static clearInterval(id: number): void;
|
|
11
|
+
}
|
|
12
|
+
export declare class ObservableWrapper {
|
|
13
|
+
static subscribe<T>(emitter: any, onNext: (value: T) => void, onError?: (exception: any) => void, onComplete?: () => void): Object;
|
|
14
|
+
static isObservable(obs: any): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Returns whether `obs` has any subscribers listening to events.
|
|
17
|
+
*/
|
|
18
|
+
static hasSubscribers(obs: EventEmitter<any>): boolean;
|
|
19
|
+
static dispose(subscription: any): void;
|
|
20
|
+
/**
|
|
21
|
+
* @deprecated - use callEmit() instead
|
|
22
|
+
*/
|
|
23
|
+
static callNext(emitter: EventEmitter<any>, value: any): void;
|
|
24
|
+
static callEmit(emitter: EventEmitter<any>, value: any): void;
|
|
25
|
+
static callError(emitter: EventEmitter<any>, error: any): void;
|
|
26
|
+
static callComplete(emitter: EventEmitter<any>): void;
|
|
27
|
+
static fromPromise(promise: Promise<any>): Observable<any>;
|
|
28
|
+
static toPromise(obj: Observable<any>): Promise<any>;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Use by directives and components to emit custom Events.
|
|
32
|
+
*
|
|
33
|
+
* ### Examples
|
|
34
|
+
*
|
|
35
|
+
* In the following example, `Zippy` alternatively emits `open` and `close` events when its
|
|
36
|
+
* title gets clicked:
|
|
37
|
+
*
|
|
38
|
+
* ```
|
|
39
|
+
* @Component({
|
|
40
|
+
* selector: 'zippy',
|
|
41
|
+
* template: `
|
|
42
|
+
* <div class="zippy">
|
|
43
|
+
* <div (click)="toggle()">Toggle</div>
|
|
44
|
+
* <div [hidden]="!visible">
|
|
45
|
+
* <ng-content></ng-content>
|
|
46
|
+
* </div>
|
|
47
|
+
* </div>`})
|
|
48
|
+
* export class Zippy {
|
|
49
|
+
* visible: boolean = true;
|
|
50
|
+
* @Output() open: EventEmitter<any> = new EventEmitter();
|
|
51
|
+
* @Output() close: EventEmitter<any> = new EventEmitter();
|
|
52
|
+
*
|
|
53
|
+
* toggle() {
|
|
54
|
+
* this.visible = !this.visible;
|
|
55
|
+
* if (this.visible) {
|
|
56
|
+
* this.open.emit(null);
|
|
57
|
+
* } else {
|
|
58
|
+
* this.close.emit(null);
|
|
59
|
+
* }
|
|
60
|
+
* }
|
|
61
|
+
* }
|
|
62
|
+
* ```
|
|
63
|
+
*
|
|
64
|
+
* The events payload can be accessed by the parameter `$event` on the components output event
|
|
65
|
+
* handler:
|
|
66
|
+
*
|
|
67
|
+
* ```
|
|
68
|
+
* <zippy (open)="onOpen($event)" (close)="onClose($event)"></zippy>
|
|
69
|
+
* ```
|
|
70
|
+
*
|
|
71
|
+
* Uses Rx.Observable but provides an adapter to make it work as specified here:
|
|
72
|
+
* https://github.com/jhusain/observable-spec
|
|
73
|
+
*
|
|
74
|
+
* Once a reference implementation of the spec is available, switch to it.
|
|
75
|
+
* @stable
|
|
76
|
+
*/
|
|
77
|
+
export declare class EventEmitter<T> extends Subject<T> {
|
|
78
|
+
__isAsync: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Creates an instance of [EventEmitter], which depending on [isAsync],
|
|
81
|
+
* delivers events synchronously or asynchronously.
|
|
82
|
+
*/
|
|
83
|
+
constructor(isAsync?: boolean);
|
|
84
|
+
emit(value: T): void;
|
|
85
|
+
/**
|
|
86
|
+
* @deprecated - use .emit(value) instead
|
|
87
|
+
*/
|
|
88
|
+
next(value: any): void;
|
|
89
|
+
subscribe(generatorOrNext?: any, error?: any, complete?: any): any;
|
|
90
|
+
}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || function (d, b) {
|
|
3
|
+
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
|
|
4
|
+
function __() { this.constructor = d; }
|
|
5
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
6
|
+
};
|
|
7
|
+
var Subject_1 = require('rxjs/Subject');
|
|
8
|
+
var PromiseObservable_1 = require('rxjs/observable/PromiseObservable');
|
|
9
|
+
var toPromise_1 = require('rxjs/operator/toPromise');
|
|
10
|
+
var lang_1 = require('./lang');
|
|
11
|
+
var Observable_1 = require('rxjs/Observable');
|
|
12
|
+
exports.Observable = Observable_1.Observable;
|
|
13
|
+
var Subject_2 = require('rxjs/Subject');
|
|
14
|
+
exports.Subject = Subject_2.Subject;
|
|
15
|
+
var promise_1 = require('./promise');
|
|
16
|
+
exports.PromiseCompleter = promise_1.PromiseCompleter;
|
|
17
|
+
exports.PromiseWrapper = promise_1.PromiseWrapper;
|
|
18
|
+
var TimerWrapper = (function () {
|
|
19
|
+
function TimerWrapper() {
|
|
20
|
+
}
|
|
21
|
+
TimerWrapper.setTimeout = function (fn, millis) {
|
|
22
|
+
return lang_1.global.setTimeout(fn, millis);
|
|
23
|
+
};
|
|
24
|
+
TimerWrapper.clearTimeout = function (id) { lang_1.global.clearTimeout(id); };
|
|
25
|
+
TimerWrapper.setInterval = function (fn, millis) {
|
|
26
|
+
return lang_1.global.setInterval(fn, millis);
|
|
27
|
+
};
|
|
28
|
+
TimerWrapper.clearInterval = function (id) { lang_1.global.clearInterval(id); };
|
|
29
|
+
return TimerWrapper;
|
|
30
|
+
}());
|
|
31
|
+
exports.TimerWrapper = TimerWrapper;
|
|
32
|
+
var ObservableWrapper = (function () {
|
|
33
|
+
function ObservableWrapper() {
|
|
34
|
+
}
|
|
35
|
+
// TODO(vsavkin): when we use rxnext, try inferring the generic type from the first arg
|
|
36
|
+
ObservableWrapper.subscribe = function (emitter, onNext, onError, onComplete) {
|
|
37
|
+
if (onComplete === void 0) { onComplete = function () { }; }
|
|
38
|
+
onError = (typeof onError === 'function') && onError || lang_1.noop;
|
|
39
|
+
onComplete = (typeof onComplete === 'function') && onComplete || lang_1.noop;
|
|
40
|
+
return emitter.subscribe({ next: onNext, error: onError, complete: onComplete });
|
|
41
|
+
};
|
|
42
|
+
ObservableWrapper.isObservable = function (obs) { return !!obs.subscribe; };
|
|
43
|
+
/**
|
|
44
|
+
* Returns whether `obs` has any subscribers listening to events.
|
|
45
|
+
*/
|
|
46
|
+
ObservableWrapper.hasSubscribers = function (obs) { return obs.observers.length > 0; };
|
|
47
|
+
ObservableWrapper.dispose = function (subscription) { subscription.unsubscribe(); };
|
|
48
|
+
/**
|
|
49
|
+
* @deprecated - use callEmit() instead
|
|
50
|
+
*/
|
|
51
|
+
ObservableWrapper.callNext = function (emitter, value) { emitter.next(value); };
|
|
52
|
+
ObservableWrapper.callEmit = function (emitter, value) { emitter.emit(value); };
|
|
53
|
+
ObservableWrapper.callError = function (emitter, error) { emitter.error(error); };
|
|
54
|
+
ObservableWrapper.callComplete = function (emitter) { emitter.complete(); };
|
|
55
|
+
ObservableWrapper.fromPromise = function (promise) {
|
|
56
|
+
return PromiseObservable_1.PromiseObservable.create(promise);
|
|
57
|
+
};
|
|
58
|
+
ObservableWrapper.toPromise = function (obj) { return toPromise_1.toPromise.call(obj); };
|
|
59
|
+
return ObservableWrapper;
|
|
60
|
+
}());
|
|
61
|
+
exports.ObservableWrapper = ObservableWrapper;
|
|
62
|
+
/**
|
|
63
|
+
* Use by directives and components to emit custom Events.
|
|
64
|
+
*
|
|
65
|
+
* ### Examples
|
|
66
|
+
*
|
|
67
|
+
* In the following example, `Zippy` alternatively emits `open` and `close` events when its
|
|
68
|
+
* title gets clicked:
|
|
69
|
+
*
|
|
70
|
+
* ```
|
|
71
|
+
* @Component({
|
|
72
|
+
* selector: 'zippy',
|
|
73
|
+
* template: `
|
|
74
|
+
* <div class="zippy">
|
|
75
|
+
* <div (click)="toggle()">Toggle</div>
|
|
76
|
+
* <div [hidden]="!visible">
|
|
77
|
+
* <ng-content></ng-content>
|
|
78
|
+
* </div>
|
|
79
|
+
* </div>`})
|
|
80
|
+
* export class Zippy {
|
|
81
|
+
* visible: boolean = true;
|
|
82
|
+
* @Output() open: EventEmitter<any> = new EventEmitter();
|
|
83
|
+
* @Output() close: EventEmitter<any> = new EventEmitter();
|
|
84
|
+
*
|
|
85
|
+
* toggle() {
|
|
86
|
+
* this.visible = !this.visible;
|
|
87
|
+
* if (this.visible) {
|
|
88
|
+
* this.open.emit(null);
|
|
89
|
+
* } else {
|
|
90
|
+
* this.close.emit(null);
|
|
91
|
+
* }
|
|
92
|
+
* }
|
|
93
|
+
* }
|
|
94
|
+
* ```
|
|
95
|
+
*
|
|
96
|
+
* The events payload can be accessed by the parameter `$event` on the components output event
|
|
97
|
+
* handler:
|
|
98
|
+
*
|
|
99
|
+
* ```
|
|
100
|
+
* <zippy (open)="onOpen($event)" (close)="onClose($event)"></zippy>
|
|
101
|
+
* ```
|
|
102
|
+
*
|
|
103
|
+
* Uses Rx.Observable but provides an adapter to make it work as specified here:
|
|
104
|
+
* https://github.com/jhusain/observable-spec
|
|
105
|
+
*
|
|
106
|
+
* Once a reference implementation of the spec is available, switch to it.
|
|
107
|
+
* @stable
|
|
108
|
+
*/
|
|
109
|
+
var EventEmitter = (function (_super) {
|
|
110
|
+
__extends(EventEmitter, _super);
|
|
111
|
+
/**
|
|
112
|
+
* Creates an instance of [EventEmitter], which depending on [isAsync],
|
|
113
|
+
* delivers events synchronously or asynchronously.
|
|
114
|
+
*/
|
|
115
|
+
function EventEmitter(isAsync) {
|
|
116
|
+
if (isAsync === void 0) { isAsync = false; }
|
|
117
|
+
_super.call(this);
|
|
118
|
+
this.__isAsync = isAsync;
|
|
119
|
+
}
|
|
120
|
+
EventEmitter.prototype.emit = function (value) { _super.prototype.next.call(this, value); };
|
|
121
|
+
/**
|
|
122
|
+
* @deprecated - use .emit(value) instead
|
|
123
|
+
*/
|
|
124
|
+
EventEmitter.prototype.next = function (value) { _super.prototype.next.call(this, value); };
|
|
125
|
+
EventEmitter.prototype.subscribe = function (generatorOrNext, error, complete) {
|
|
126
|
+
var schedulerFn;
|
|
127
|
+
var errorFn = function (err) { return null; };
|
|
128
|
+
var completeFn = function () { return null; };
|
|
129
|
+
if (generatorOrNext && typeof generatorOrNext === 'object') {
|
|
130
|
+
schedulerFn = this.__isAsync ? function (value /** TODO #9100 */) {
|
|
131
|
+
setTimeout(function () { return generatorOrNext.next(value); });
|
|
132
|
+
} : function (value /** TODO #9100 */) { generatorOrNext.next(value); };
|
|
133
|
+
if (generatorOrNext.error) {
|
|
134
|
+
errorFn = this.__isAsync ? function (err) { setTimeout(function () { return generatorOrNext.error(err); }); } :
|
|
135
|
+
function (err) { generatorOrNext.error(err); };
|
|
136
|
+
}
|
|
137
|
+
if (generatorOrNext.complete) {
|
|
138
|
+
completeFn = this.__isAsync ? function () { setTimeout(function () { return generatorOrNext.complete(); }); } :
|
|
139
|
+
function () { generatorOrNext.complete(); };
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
schedulerFn = this.__isAsync ? function (value /** TODO #9100 */) {
|
|
144
|
+
setTimeout(function () { return generatorOrNext(value); });
|
|
145
|
+
} : function (value /** TODO #9100 */) { generatorOrNext(value); };
|
|
146
|
+
if (error) {
|
|
147
|
+
errorFn =
|
|
148
|
+
this.__isAsync ? function (err) { setTimeout(function () { return error(err); }); } : function (err) { error(err); };
|
|
149
|
+
}
|
|
150
|
+
if (complete) {
|
|
151
|
+
completeFn =
|
|
152
|
+
this.__isAsync ? function () { setTimeout(function () { return complete(); }); } : function () { complete(); };
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
return _super.prototype.subscribe.call(this, schedulerFn, errorFn, completeFn);
|
|
156
|
+
};
|
|
157
|
+
return EventEmitter;
|
|
158
|
+
}(Subject_1.Subject));
|
|
159
|
+
exports.EventEmitter = EventEmitter;
|
|
160
|
+
//# sourceMappingURL=async.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"async.js","sourceRoot":"","sources":["../../../../../modules/@angular/platform-browser-dynamic/src/facade/async.ts"],"names":[],"mappings":";;;;;;AACA,wBAAsB,cAAc,CAAC,CAAA;AACrC,kCAAgC,mCAAmC,CAAC,CAAA;AACpE,0BAAwB,yBAAyB,CAAC,CAAA;AAElD,qBAA2B,QAAQ,CAAC,CAAA;AAEpC,2BAAyB,iBAAiB,CAAC;AAAnC,6CAAmC;AAC3C,wBAAsB,cAAc,CAAC;AAA7B,oCAA6B;AACrC,wBAA+C,WAAW,CAAC;AAAnD,sDAAgB;AAAE,kDAAiC;AAE3D;IAAA;IAUA,CAAC;IATQ,uBAAU,GAAjB,UAAkB,EAA4B,EAAE,MAAc;QAC5D,MAAM,CAAC,aAAM,CAAC,UAAU,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;IACvC,CAAC;IACM,yBAAY,GAAnB,UAAoB,EAAU,IAAU,aAAM,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAE3D,wBAAW,GAAlB,UAAmB,EAA4B,EAAE,MAAc;QAC7D,MAAM,CAAC,aAAM,CAAC,WAAW,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;IACxC,CAAC;IACM,0BAAa,GAApB,UAAqB,EAAU,IAAU,aAAM,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACtE,mBAAC;AAAD,CAAC,AAVD,IAUC;AAVY,oBAAY,eAUxB,CAAA;AAED;IAAA;IAmCA,CAA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ACN,IAAI,CAAC,SAAS,GAAG,cAAQ,UAAU,CAAC,cAAM,OAAA,QAAQ,EAAE,EAAV,CAAU,CAAC,CAAC,CAAC,CAAC,GAAG,cAAQ,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC;YACvF,CAAC;QACH,CAAC;QAED,MAAM,CAAC,gBAAK,CAAC,SAAS,YAAC,WAAW,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;IAC3D,CAAC;IACH,mBAAC;AAAD,CAAC,AA7DD,CAAqC,iBAAO,GA6D3C;AA7DY,oBAAY,eA6DxB,CAAA","sourcesContent":["import {Observable} from 'rxjs/Observable';\nimport {Subject} from 'rxjs/Subject';\nimport {PromiseObservable} from 'rxjs/observable/PromiseObservable';\nimport {toPromise} from 'rxjs/operator/toPromise';\n\nimport {global, noop} from './lang';\n\nexport {Observable} from 'rxjs/Observable';\nexport {Subject} from 'rxjs/Subject';\nexport {PromiseCompleter, PromiseWrapper} from './promise';\n\nexport class TimerWrapper {\n static setTimeout(fn: (...args: any[]) => void, millis: number): number {\n return global.setTimeout(fn, millis);\n }\n static clearTimeout(id: number): void { global.clearTimeout(id); }\n\n static setInterval(fn: (...args: any[]) => void, millis: number): number {\n return global.setInterval(fn, millis);\n }\n static clearInterval(id: number): void { global.clearInterval(id); }\n}\n\nexport class ObservableWrapper {\n // TODO(vsavkin): when we use rxnext, try inferring the generic type from the first arg\n static subscribe<T>(\n emitter: any, onNext: (value: T) => void, onError?: (exception: any) => void,\n onComplete: () => void = () => {}): Object {\n onError = (typeof onError === 'function') && onError || noop;\n onComplete = (typeof onComplete === 'function') && onComplete || noop;\n return emitter.subscribe({next: onNext, error: onError, complete: onComplete});\n }\n\n static isObservable(obs: any): boolean { return !!obs.subscribe; }\n\n /**\n * Returns whether `obs` has any subscribers listening to events.\n */\n static hasSubscribers(obs: EventEmitter<any>): boolean { return obs.observers.length > 0; }\n\n static dispose(subscription: any) { subscription.unsubscribe(); }\n\n /**\n * @deprecated - use callEmit() instead\n */\n static callNext(emitter: EventEmitter<any>, value: any) { emitter.next(value); }\n\n static callEmit(emitter: EventEmitter<any>, value: any) { emitter.emit(value); }\n\n static callError(emitter: EventEmitter<any>, error: any) { emitter.error(error); }\n\n static callComplete(emitter: EventEmitter<any>) { emitter.complete(); }\n\n static fromPromise(promise: Promise<any>): Observable<any> {\n return PromiseObservable.create(promise);\n }\n\n static toPromise(obj: Observable<any>): Promise<any> { return toPromise.call(obj); }\n}\n\n/**\n * Use by directives and components to emit custom Events.\n *\n * ### Examples\n *\n * In the following example, `Zippy` alternatively emits `open` and `close` events when its\n * title gets clicked:\n *\n * ```\n * @Component({\n * selector: 'zippy',\n * template: `\n * <div class=\"zippy\">\n * <div (click)=\"toggle()\">Toggle</div>\n * <div [hidden]=\"!visible\">\n * <ng-content></ng-content>\n * </div>\n * </div>`})\n * export class Zippy {\n * visible: boolean = true;\n * @Output() open: EventEmitter<any> = new EventEmitter();\n * @Output() close: EventEmitter<any> = new EventEmitter();\n *\n * toggle() {\n * this.visible = !this.visible;\n * if (this.visible) {\n * this.open.emit(null);\n * } else {\n * this.close.emit(null);\n * }\n * }\n * }\n * ```\n *\n * The events payload can be accessed by the parameter `$event` on the components output event\n * handler:\n *\n * ```\n * <zippy (open)=\"onOpen($event)\" (close)=\"onClose($event)\"></zippy>\n * ```\n *\n * Uses Rx.Observable but provides an adapter to make it work as specified here:\n * https://github.com/jhusain/observable-spec\n *\n * Once a reference implementation of the spec is available, switch to it.\n * @stable\n */\nexport class EventEmitter<T> extends Subject<T> {\n // TODO: mark this as internal once all the facades are gone\n // we can't mark it as internal now because EventEmitter exported via @angular/core would not\n // contain this property making it incompatible with all the code that uses EventEmitter via\n // facades, which are local to the code and do not have this property stripped.\n // tslint:disable-next-line\n __isAsync: boolean;\n\n /**\n * Creates an instance of [EventEmitter], which depending on [isAsync],\n * delivers events synchronously or asynchronously.\n */\n constructor(isAsync: boolean = false) {\n super();\n this.__isAsync = isAsync;\n }\n\n emit(value: T) { super.next(value); }\n\n /**\n * @deprecated - use .emit(value) instead\n */\n next(value: any) { super.next(value); }\n\n subscribe(generatorOrNext?: any, error?: any, complete?: any): any {\n let schedulerFn: any /** TODO #9100 */;\n let errorFn = (err: any): any /** TODO #9100 */ => null;\n let completeFn = (): any /** TODO #9100 */ => null;\n\n if (generatorOrNext && typeof generatorOrNext === 'object') {\n schedulerFn = this.__isAsync ? (value: any /** TODO #9100 */) => {\n setTimeout(() => generatorOrNext.next(value));\n } : (value: any /** TODO #9100 */) => { generatorOrNext.next(value); };\n\n if (generatorOrNext.error) {\n errorFn = this.__isAsync ? (err) => { setTimeout(() => generatorOrNext.error(err)); } :\n (err) => { generatorOrNext.error(err); };\n }\n\n if (generatorOrNext.complete) {\n completeFn = this.__isAsync ? () => { setTimeout(() => generatorOrNext.complete()); } :\n () => { generatorOrNext.complete(); };\n }\n } else {\n schedulerFn = this.__isAsync ? (value: any /** TODO #9100 */) => {\n setTimeout(() => generatorOrNext(value));\n } : (value: any /** TODO #9100 */) => { generatorOrNext(value); };\n\n if (error) {\n errorFn =\n this.__isAsync ? (err) => { setTimeout(() => error(err)); } : (err) => { error(err); };\n }\n\n if (complete) {\n completeFn =\n this.__isAsync ? () => { setTimeout(() => complete()); } : () => { complete(); };\n }\n }\n\n return super.subscribe(schedulerFn, errorFn, completeFn);\n }\n}\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n"]}
|
|
@@ -5,10 +5,10 @@ var __extends = (this && this.__extends) || function (d, b) {
|
|
|
5
5
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
6
6
|
};
|
|
7
7
|
/**
|
|
8
|
-
* A base class for the WrappedException that can be used to identify
|
|
9
|
-
* a WrappedException from ExceptionHandler without adding circular
|
|
10
|
-
* dependency.
|
|
11
|
-
*/
|
|
8
|
+
* A base class for the WrappedException that can be used to identify
|
|
9
|
+
* a WrappedException from ExceptionHandler without adding circular
|
|
10
|
+
* dependency.
|
|
11
|
+
*/
|
|
12
12
|
var BaseWrappedException = (function (_super) {
|
|
13
13
|
__extends(BaseWrappedException, _super);
|
|
14
14
|
function BaseWrappedException(message) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base_wrapped_exception.js","sourceRoot":"","sources":["../../../../../modules/@angular/platform-browser-dynamic/src/facade/base_wrapped_exception.ts"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"base_wrapped_exception.js","sourceRoot":"","sources":["../../../../../modules/@angular/platform-browser-dynamic/src/facade/base_wrapped_exception.ts"],"names":[],"mappings":";;;;;;AAAA;;;;GAIG;AACH;IAA0C,wCAAK;IAC7C,8BAAY,OAAe;QAAI,kBAAM,OAAO,CAAC,CAAC;IAAC,CAAC;IAEhD,sBAAI,gDAAc;aAAlB,cAA+B,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;;;OAAA;IAC3C,sBAAI,8CAAY;aAAhB,cAA0B,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;;;OAAA;IACxC,sBAAI,mDAAiB;aAArB,cAA+B,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;;;OAAA;IAC7C,sBAAI,+CAAa;aAAjB,cAA2B,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;;;OAAA;IACzC,sBAAI,yCAAO;aAAX,cAAqB,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;;;OAAA;IACnC,sBAAI,yCAAO;aAAX,cAAwB,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;;;OAAA;IACtC,2BAAC;AAAD,CAAC,AATD,CAA0C,KAAK,GAS9C;AATY,4BAAoB,uBAShC,CAAA","sourcesContent":["/**\n * A base class for the WrappedException that can be used to identify\n * a WrappedException from ExceptionHandler without adding circular\n * dependency.\n */\nexport class BaseWrappedException extends Error {\n constructor(message: string) { super(message); }\n\n get wrapperMessage(): string { return ''; }\n get wrapperStack(): any { return null; }\n get originalException(): any { return null; }\n get originalStack(): any { return null; }\n get context(): any { return null; }\n get message(): string { return ''; }\n}\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n"]}
|