Socket
Socket
Sign inDemoInstall

@angular/upgrade

Package Overview
Dependencies
Maintainers
1
Versions
844
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@angular/upgrade - npm Package Compare versions

Comparing version 4.0.0-beta.3 to 4.0.0-beta.4

492

bundles/upgrade-static.umd.js
/**
* @license Angular v4.0.0-beta.3
* @license Angular v4.0.0-beta.4
* (c) 2010-2016 Google, Inc. https://angular.io/

@@ -40,6 +40,6 @@ * License: MIT

/**
* A `PropertyBinding` represents a mapping between a property name
* and an attribute name. It is parsed from a string of the form
* `"prop: attr"`; or simply `"propAndAttr" where the property
* and attribute have the same identifier.
* A `PropertyBinding` represents a mapping between a property name
* and an attribute name. It is parsed from a string of the form
* `"prop: attr"`; or simply `"propAndAttr" where the property
* and attribute have the same identifier.
*/

@@ -252,43 +252,47 @@ var PropertyBinding = (function () {

/**
* *
* *Part of the [upgrade/static](/docs/ts/latest/api/#!?query=upgrade%2Fstatic)
* library for hybrid upgrade apps that support AoT compilation*
* *
* Allows an Angular 2+ component to be used from Angular 1.
* *
* *
* Let's assume that you have an Angular 2+ component called `ng2Heroes` that needs
* to be made available in Angular 1 templates.
* *
* {@example upgrade/static/ts/module.ts region="ng2-heroes"}
* *
* We must create an Angular 1 [directive](https://docs.angularjs.org/guide/directive)
* that will make this Angular 2+ component available inside Angular 1 templates.
* The `downgradeComponent()` function returns a factory function that we
* can use to define the Angular 1 directive that wraps the "downgraded" component.
* *
* {@example upgrade/static/ts/module.ts region="ng2-heroes-wrapper"}
* *
* In this example you can see that we must provide information about the component being
* "downgraded". This is because once the AoT compiler has run, all metadata about the
* component has been removed from the code, and so cannot be inferred.
* *
* We must do the following:
* * specify the Angular 2+ component class that is to be downgraded
* * specify all inputs and outputs that the Angular 1 component expects
* *
* *
* A helper function that returns a factory function to be used for registering an
* Angular 1 wrapper directive for "downgrading" an Angular 2+ component.
* *
* The parameter contains information about the Component that is being downgraded:
* *
* * `component: Type<any>`: The type of the Component that will be downgraded
* * `inputs: string[]`: A collection of strings that specify what inputs the component accepts.
* * `outputs: string[]`: A collection of strings that specify what outputs the component emits.
* *
* The `inputs` and `outputs` are strings that map the names of properties to camelCased
* attribute names. They are of the form `"prop: attr"`; or simply `"propAndAttr" where the
* property and attribute have the same identifier.
* *
* \@whatItDoes
*
* *Part of the [upgrade/static](/docs/ts/latest/api/#!?query=upgrade%2Fstatic)
* library for hybrid upgrade apps that support AoT compilation*
*
* Allows an Angular 2+ component to be used from Angular 1.
*
* \@howToUse
*
* Let's assume that you have an Angular 2+ component called `ng2Heroes` that needs
* to be made available in Angular 1 templates.
*
* {\@example upgrade/static/ts/module.ts region="ng2-heroes"}
*
* We must create an Angular 1 [directive](https://docs.angularjs.org/guide/directive)
* that will make this Angular 2+ component available inside Angular 1 templates.
* The `downgradeComponent()` function returns a factory function that we
* can use to define the Angular 1 directive that wraps the "downgraded" component.
*
* {\@example upgrade/static/ts/module.ts region="ng2-heroes-wrapper"}
*
* In this example you can see that we must provide information about the component being
* "downgraded". This is because once the AoT compiler has run, all metadata about the
* component has been removed from the code, and so cannot be inferred.
*
* We must do the following:
* * specify the Angular 2+ component class that is to be downgraded
* * specify all inputs and outputs that the Angular 1 component expects
*
* \@description
*
* A helper function that returns a factory function to be used for registering an
* Angular 1 wrapper directive for "downgrading" an Angular 2+ component.
*
* The parameter contains information about the Component that is being downgraded:
*
* * `component: Type<any>`: The type of the Component that will be downgraded
* * `inputs: string[]`: A collection of strings that specify what inputs the component accepts.
* * `outputs: string[]`: A collection of strings that specify what outputs the component emits.
*
* The `inputs` and `outputs` are strings that map the names of properties to camelCased
* attribute names. They are of the form `"prop: attr"`; or simply `"propAndAttr" where the
* property and attribute have the same identifier.
*
* \@experimental
* @param {?} info

@@ -327,38 +331,42 @@ * @return {?}

/**
* *
* *Part of the [upgrade/static](/docs/ts/latest/api/#!?query=upgrade%2Fstatic)
* library for hybrid upgrade apps that support AoT compilation*
* *
* Allow an Angular 2+ service to be accessible from Angular 1.
* *
* *
* First ensure that the service to be downgraded is provided in an {@link NgModule}
* that will be part of the upgrade application. For example, let's assume we have
* defined `HeroesService`
* *
* {@example upgrade/static/ts/module.ts region="ng2-heroes-service"}
* *
* and that we have included this in our upgrade app {@link NgModule}
* *
* {@example upgrade/static/ts/module.ts region="ng2-module"}
* *
* Now we can register the `downgradeInjectable` factory function for the service
* on an Angular 1 module.
* *
* {@example upgrade/static/ts/module.ts region="downgrade-ng2-heroes-service"}
* *
* Inside an Angular 1 component's controller we can get hold of the
* downgraded service via the name we gave when downgrading.
* *
* {@example upgrade/static/ts/module.ts region="example-app"}
* *
* *
* Takes a `token` that identifies a service provided from Angular 2+.
* *
* Returns a [factory function](https://docs.angularjs.org/guide/di) that can be
* used to register the service on an Angular 1 module.
* *
* The factory function provides access to the Angular 2+ service that
* is identified by the `token` parameter.
* *
* \@whatItDoes
*
* *Part of the [upgrade/static](/docs/ts/latest/api/#!?query=upgrade%2Fstatic)
* library for hybrid upgrade apps that support AoT compilation*
*
* Allow an Angular 2+ service to be accessible from Angular 1.
*
* \@howToUse
*
* First ensure that the service to be downgraded is provided in an {\@link NgModule}
* that will be part of the upgrade application. For example, let's assume we have
* defined `HeroesService`
*
* {\@example upgrade/static/ts/module.ts region="ng2-heroes-service"}
*
* and that we have included this in our upgrade app {\@link NgModule}
*
* {\@example upgrade/static/ts/module.ts region="ng2-module"}
*
* Now we can register the `downgradeInjectable` factory function for the service
* on an Angular 1 module.
*
* {\@example upgrade/static/ts/module.ts region="downgrade-ng2-heroes-service"}
*
* Inside an Angular 1 component's controller we can get hold of the
* downgraded service via the name we gave when downgrading.
*
* {\@example upgrade/static/ts/module.ts region="example-app"}
*
* \@description
*
* Takes a `token` that identifies a service provided from Angular 2+.
*
* Returns a [factory function](https://docs.angularjs.org/guide/di) that can be
* used to register the service on an Angular 1 module.
*
* The factory function provides access to the Angular 2+ service that
* is identified by the `token` parameter.
*
* \@experimental
* @param {?} token

@@ -435,53 +443,57 @@ * @return {?}

/**
* *
* *Part of the [upgrade/static](/docs/ts/latest/api/#!?query=upgrade%2Fstatic)
* library for hybrid upgrade apps that support AoT compilation*
* *
* Allows an Angular 1 component to be used from Angular 2+.
* *
* *
* Let's assume that you have an Angular 1 component called `ng1Hero` that needs
* to be made available in Angular 2+ templates.
* *
* {@example upgrade/static/ts/module.ts region="ng1-hero"}
* *
* We must create a {@link Directive} that will make this Angular 1 component
* available inside Angular 2+ templates.
* *
* {@example upgrade/static/ts/module.ts region="ng1-hero-wrapper"}
* *
* In this example you can see that we must derive from the {@link UpgradeComponent}
* base class but also provide an {@link Directive `@Directive`} decorator. This is
* because the AoT compiler requires that this information is statically available at
* compile time.
* *
* Note that we must do the following:
* * specify the directive's selector (`ng1-hero`)
* * specify all inputs and outputs that the Angular 1 component expects
* * derive from `UpgradeComponent`
* * call the base class from the constructor, passing
* * the Angular 1 name of the component (`ng1Hero`)
* * the {@link ElementRef} and {@link Injector} for the component wrapper
* *
* *
* A helper class that should be used as a base class for creating Angular directives
* that wrap Angular 1 components that need to be "upgraded".
* *
* \@whatItDoes
*
* *Part of the [upgrade/static](/docs/ts/latest/api/#!?query=upgrade%2Fstatic)
* library for hybrid upgrade apps that support AoT compilation*
*
* Allows an Angular 1 component to be used from Angular 2+.
*
* \@howToUse
*
* Let's assume that you have an Angular 1 component called `ng1Hero` that needs
* to be made available in Angular 2+ templates.
*
* {\@example upgrade/static/ts/module.ts region="ng1-hero"}
*
* We must create a {\@link Directive} that will make this Angular 1 component
* available inside Angular 2+ templates.
*
* {\@example upgrade/static/ts/module.ts region="ng1-hero-wrapper"}
*
* In this example you can see that we must derive from the {\@link UpgradeComponent}
* base class but also provide an {\@link Directive `\@Directive`} decorator. This is
* because the AoT compiler requires that this information is statically available at
* compile time.
*
* Note that we must do the following:
* * specify the directive's selector (`ng1-hero`)
* * specify all inputs and outputs that the Angular 1 component expects
* * derive from `UpgradeComponent`
* * call the base class from the constructor, passing
* * the Angular 1 name of the component (`ng1Hero`)
* * the {\@link ElementRef} and {\@link Injector} for the component wrapper
*
* \@description
*
* A helper class that should be used as a base class for creating Angular directives
* that wrap Angular 1 components that need to be "upgraded".
*
* \@experimental
*/
var UpgradeComponent = (function () {
/**
* Create a new `UpgradeComponent` instance. You should not normally need to do this.
* Instead you should derive a new class from this one and call the super constructor
* from the base class.
* *
* {@example upgrade/static/ts/module.ts region="ng1-hero-wrapper" }
* *
* * The `name` parameter should be the name of the Angular 1 directive.
* * The `elementRef` and `injector` parameters should be acquired from Angular by dependency
* injection into the base class constructor.
* *
* Note that we must manually implement lifecycle hooks that call through to the super class.
* This is because, at the moment, the AoT compiler is not able to tell that the
* `UpgradeComponent`
* already implements them and so does not wire up calls to them at runtime.
* Create a new `UpgradeComponent` instance. You should not normally need to do this.
* Instead you should derive a new class from this one and call the super constructor
* from the base class.
*
* {\@example upgrade/static/ts/module.ts region="ng1-hero-wrapper" }
*
* * The `name` parameter should be the name of the Angular 1 directive.
* * The `elementRef` and `injector` parameters should be acquired from Angular by dependency
* injection into the base class constructor.
*
* Note that we must manually implement lifecycle hooks that call through to the super class.
* This is because, at the moment, the AoT compiler is not able to tell that the
* `UpgradeComponent`
* already implements them and so does not wire up calls to them at runtime.
* @param {?} name

@@ -890,109 +902,113 @@ * @param {?} elementRef

/**
* *
* *Part of the [upgrade/static](/docs/ts/latest/api/#!?query=upgrade%2Fstatic)
* library for hybrid upgrade apps that support AoT compilation*
* *
* Allows Angular 1 and Angular 2+ components to be used together inside a hybrid upgrade
* application, which supports AoT compilation.
* *
* Specifically, the classes and functions in the `upgrade/static` module allow the following:
* 1. Creation of an Angular 2+ directive that wraps and exposes an Angular 1 component so
* that it can be used in an Angular 2 template. See {@link UpgradeComponent}.
* 2. Creation of an Angular 1 directive that wraps and exposes an Angular 2+ component so
* that it can be used in an Angular 1 template. See {@link downgradeComponent}.
* 3. Creation of an Angular 2+ root injector provider that wraps and exposes an Angular 1
* service so that it can be injected into an Angular 2+ context. See
* {@link UpgradeModule#upgrading-an-angular-1-service Upgrading an Angular 1 service} below.
* 4. Creation of an Angular 1 service that wraps and exposes an Angular 2+ injectable
* so that it can be injected into an Angular 1 context. See {@link downgradeInjectable}.
* 3. Bootstrapping of a hybrid Angular application which contains both of the frameworks
* coexisting in a single application. See the
* {@link UpgradeModule#example example} below.
* *
* ## Mental Model
* *
* When reasoning about how a hybrid application works it is useful to have a mental model which
* describes what is happening and explains what is happening at the lowest level.
* *
* 1. There are two independent frameworks running in a single application, each framework treats
* the other as a black box.
* 2. Each DOM element on the page is owned exactly by one framework. Whichever framework
* instantiated the element is the owner. Each framework only updates/interacts with its own
* DOM elements and ignores others.
* 3. Angular 1 directives always execute inside the Angular 1 framework codebase regardless of
* where they are instantiated.
* 4. Angular 2+ components always execute inside the Angular 2+ framework codebase regardless of
* where they are instantiated.
* 5. An Angular 1 component can be "upgraded"" to an Angular 2+ component. This is achieved by
* defining an Angular 2+ directive, which bootstraps the Angular 1 component at its location
* in the DOM. See {@link UpgradeComponent}.
* 6. An Angular 2+ component can be "downgraded"" to an Angular 1 component. This is achieved by
* defining an Angular 1 directive, which bootstraps the Angular 2+ component at its location
* in the DOM. See {@link downgradeComponent}.
* 7. Whenever an "upgraded"/"downgraded" component is instantiated the host element is owned by
* the framework doing the instantiation. The other framework then instantiates and owns the
* view for that component.
* a. This implies that the component bindings will always follow the semantics of the
* instantiation framework.
* b. The DOM attributes are parsed by the framework that owns the current template. So
* attributes
* in Angular 1 templates must use kebab-case, while Angular 1 templates must use camelCase.
* c. However the template binding syntax will always use the Angular 2+ style, e.g. square
* brackets (`[...]`) for property binding.
* 8. Angular 1 is always bootstrapped first and owns the root component.
* 9. The new application is running in an Angular 2+ zone, and therefore it no longer needs calls
* to
* `$apply()`.
* *
* *
* `import {UpgradeModule} from '@angular/upgrade/static';`
* *
* ## Example
* Import the {@link UpgradeModule} into your top level {@link NgModule Angular 2+ `NgModule`}.
* *
* {@example upgrade/static/ts/module.ts region='ng2-module'}
* *
* Then bootstrap the hybrid upgrade app's module, get hold of the {@link UpgradeModule} instance
* and use it to bootstrap the top level [Angular 1
* module](https://docs.angularjs.org/api/ng/type/angular.Module).
* *
* {@example upgrade/static/ts/module.ts region='bootstrap'}
* *
* *
* ## Upgrading an Angular 1 service
* *
* There is no specific API for upgrading an Angular 1 service. Instead you should just follow the
* following recipe:
* *
* Let's say you have an Angular 1 service:
* *
* {@example upgrade/static/ts/module.ts region="ng1-title-case-service"}
* *
* Then you should define an Angular 2+ provider to be included in your {@link NgModule} `providers`
* property.
* *
* {@example upgrade/static/ts/module.ts region="upgrade-ng1-service"}
* *
* Then you can use the "upgraded" Angular 1 service by injecting it into an Angular 2 component
* or service.
* *
* {@example upgrade/static/ts/module.ts region="use-ng1-upgraded-service"}
* *
* *
* This class is an `NgModule`, which you import to provide Angular 1 core services,
* and has an instance method used to bootstrap the hybrid upgrade application.
* *
* ## Core Angular 1 services
* Importing this {@link NgModule} will add providers for the core
* [Angular 1 services](https://docs.angularjs.org/api/ng/service) to the root injector.
* *
* ## Bootstrap
* The runtime instance of this class contains a {@link UpgradeModule#bootstrap `bootstrap()`}
* method, which you use to bootstrap the top level Angular 1 module onto an element in the
* DOM for the hybrid upgrade app.
* *
* It also contains properties to access the {@link UpgradeModule#injector root injector}, the
* bootstrap {@link NgZone} and the
* [Angular 1 $injector](https://docs.angularjs.org/api/auto/service/$injector).
* *
* \@whatItDoes
*
* *Part of the [upgrade/static](/docs/ts/latest/api/#!?query=upgrade%2Fstatic)
* library for hybrid upgrade apps that support AoT compilation*
*
* Allows Angular 1 and Angular 2+ components to be used together inside a hybrid upgrade
* application, which supports AoT compilation.
*
* Specifically, the classes and functions in the `upgrade/static` module allow the following:
* 1. Creation of an Angular 2+ directive that wraps and exposes an Angular 1 component so
* that it can be used in an Angular 2 template. See {\@link UpgradeComponent}.
* 2. Creation of an Angular 1 directive that wraps and exposes an Angular 2+ component so
* that it can be used in an Angular 1 template. See {\@link downgradeComponent}.
* 3. Creation of an Angular 2+ root injector provider that wraps and exposes an Angular 1
* service so that it can be injected into an Angular 2+ context. See
* {\@link UpgradeModule#upgrading-an-angular-1-service Upgrading an Angular 1 service} below.
* 4. Creation of an Angular 1 service that wraps and exposes an Angular 2+ injectable
* so that it can be injected into an Angular 1 context. See {\@link downgradeInjectable}.
* 3. Bootstrapping of a hybrid Angular application which contains both of the frameworks
* coexisting in a single application. See the
* {\@link UpgradeModule#example example} below.
*
* ## Mental Model
*
* When reasoning about how a hybrid application works it is useful to have a mental model which
* describes what is happening and explains what is happening at the lowest level.
*
* 1. There are two independent frameworks running in a single application, each framework treats
* the other as a black box.
* 2. Each DOM element on the page is owned exactly by one framework. Whichever framework
* instantiated the element is the owner. Each framework only updates/interacts with its own
* DOM elements and ignores others.
* 3. Angular 1 directives always execute inside the Angular 1 framework codebase regardless of
* where they are instantiated.
* 4. Angular 2+ components always execute inside the Angular 2+ framework codebase regardless of
* where they are instantiated.
* 5. An Angular 1 component can be "upgraded"" to an Angular 2+ component. This is achieved by
* defining an Angular 2+ directive, which bootstraps the Angular 1 component at its location
* in the DOM. See {\@link UpgradeComponent}.
* 6. An Angular 2+ component can be "downgraded"" to an Angular 1 component. This is achieved by
* defining an Angular 1 directive, which bootstraps the Angular 2+ component at its location
* in the DOM. See {\@link downgradeComponent}.
* 7. Whenever an "upgraded"/"downgraded" component is instantiated the host element is owned by
* the framework doing the instantiation. The other framework then instantiates and owns the
* view for that component.
* a. This implies that the component bindings will always follow the semantics of the
* instantiation framework.
* b. The DOM attributes are parsed by the framework that owns the current template. So
* attributes
* in Angular 1 templates must use kebab-case, while Angular 1 templates must use camelCase.
* c. However the template binding syntax will always use the Angular 2+ style, e.g. square
* brackets (`[...]`) for property binding.
* 8. Angular 1 is always bootstrapped first and owns the root component.
* 9. The new application is running in an Angular 2+ zone, and therefore it no longer needs calls
* to
* `$apply()`.
*
* \@howToUse
*
* `import {UpgradeModule} from '\@angular/upgrade/static';`
*
* ## Example
* Import the {\@link UpgradeModule} into your top level {\@link NgModule Angular 2+ `NgModule`}.
*
* {\@example upgrade/static/ts/module.ts region='ng2-module'}
*
* Then bootstrap the hybrid upgrade app's module, get hold of the {\@link UpgradeModule} instance
* and use it to bootstrap the top level [Angular 1
* module](https://docs.angularjs.org/api/ng/type/angular.Module).
*
* {\@example upgrade/static/ts/module.ts region='bootstrap'}
*
*
* ## Upgrading an Angular 1 service
*
* There is no specific API for upgrading an Angular 1 service. Instead you should just follow the
* following recipe:
*
* Let's say you have an Angular 1 service:
*
* {\@example upgrade/static/ts/module.ts region="ng1-title-case-service"}
*
* Then you should define an Angular 2+ provider to be included in your {\@link NgModule} `providers`
* property.
*
* {\@example upgrade/static/ts/module.ts region="upgrade-ng1-service"}
*
* Then you can use the "upgraded" Angular 1 service by injecting it into an Angular 2 component
* or service.
*
* {\@example upgrade/static/ts/module.ts region="use-ng1-upgraded-service"}
*
* \@description
*
* This class is an `NgModule`, which you import to provide Angular 1 core services,
* and has an instance method used to bootstrap the hybrid upgrade application.
*
* ## Core Angular 1 services
* Importing this {\@link NgModule} will add providers for the core
* [Angular 1 services](https://docs.angularjs.org/api/ng/service) to the root injector.
*
* ## Bootstrap
* The runtime instance of this class contains a {\@link UpgradeModule#bootstrap `bootstrap()`}
* method, which you use to bootstrap the top level Angular 1 module onto an element in the
* DOM for the hybrid upgrade app.
*
* It also contains properties to access the {\@link UpgradeModule#injector root injector}, the
* bootstrap {\@link NgZone} and the
* [Angular 1 $injector](https://docs.angularjs.org/api/auto/service/$injector).
*
* \@experimental
*/

@@ -1009,3 +1025,3 @@ var UpgradeModule = (function () {

/**
* Bootstrap an Angular 1 application from this NgModule
* Bootstrap an Angular 1 application from this NgModule
* @param {?} element the element on which to bootstrap the Angular 1 application

@@ -1012,0 +1028,0 @@ * @param {?=} modules

/**
* @license Angular v4.0.0-beta.3
* @license Angular v4.0.0-beta.4
* (c) 2010-2016 Google, Inc. https://angular.io/

@@ -4,0 +4,0 @@ * License: MIT

/**
* @license Angular v4.0.0-beta.3
* @license Angular v4.0.0-beta.4
* (c) 2010-2016 Google, Inc. https://angular.io/

@@ -7,17 +7,17 @@ * License: MIT

!function(global,factory){"object"==typeof exports&&"undefined"!=typeof module?factory(exports,require("@angular/compiler"),require("@angular/core"),require("@angular/platform-browser-dynamic")):"function"==typeof define&&define.amd?define(["exports","@angular/compiler","@angular/core","@angular/platform-browser-dynamic"],factory):factory((global.ng=global.ng||{},global.ng.upgrade=global.ng.upgrade||{}),global.ng.compiler,global.ng.core,global.ng.platformBrowserDynamic)}(this,function(exports,_angular_compiler,_angular_core,_angular_platformBrowserDynamic){"use strict";/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
function noNg(){throw new Error("AngularJS v1.x is not loaded!")}function getComponentInfo(type){var resolvedMetadata=directiveResolver.resolve(type),selector=resolvedMetadata.selector;if(!selector.match(COMPONENT_SELECTOR))throw new Error("Only selectors matching element names are supported, got: "+selector);return selector=selector.replace(SKEWER_CASE,function(all,letter){return letter.toUpperCase()}),{type:type,selector:selector,inputs:parseFields(resolvedMetadata.inputs),outputs:parseFields(resolvedMetadata.outputs)}}function parseFields(names){var attrProps=[];if(names)for(var i=0;i<names.length;i++){var parts=names[i].split(":"),prop=parts[0].trim(),attr=(parts[1]||parts[0]).trim(),capitalAttr=attr.charAt(0).toUpperCase()+attr.substr(1);attrProps.push({prop:prop,attr:attr,bracketAttr:"["+attr+"]",parenAttr:"("+attr+")",bracketParenAttr:"[("+attr+")]",onAttr:"on"+capitalAttr,bindAttr:"bind"+capitalAttr,bindonAttr:"bindon"+capitalAttr})}return attrProps}/**
* @license undefined
* Copyright Google Inc. All Rights Reserved.
* *
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
* @param {?} e
* @return {?}
*/
function onError(e){throw console.error?console.error(e,e.stack):console.log(e,e.stack),e}function controllerKey(name){return"$"+name+"Controller"}function getAttributesAsArray(node){var asArray,attributes=node.attributes;if(attributes){var attrLen=attributes.length;asArray=new Array(attrLen);for(var i=0;i<attrLen;i++)asArray[i]=[attributes[i].nodeName,attributes[i].nodeValue]}return asArray||[]}function isFunction(value){return"function"==typeof value}function ng1ComponentDirective(info,idPrefix){function directiveFactory(ng1Injector,ng1Compile,componentFactoryRefMap,parse){function compileProjectedNodes(templateElement,ngContentSelectors){if(!ngContentSelectors)throw new Error("Expecting ngContentSelectors for: "+info.selector);var projectableTemplateNodes=sortProjectableNodes(ngContentSelectors,templateElement.contents());return projectableTemplateNodes.map(function(nodes){return ng1Compile(nodes)})}var idCount=0;info.selector.replace(/[A-Z]/g,function(char){return"-"+char.toLowerCase()});return{restrict:"E",terminal:!0,require:REQUIRE_INJECTOR,compile:function(templateElement,templateAttributes,transclude){return{post:function(scope,element,attrs,parentInjector,transclude){function downgrade(injector){var facade=new DowngradeNg2ComponentAdapter(info,element,attrs,scope,injector,parse,componentFactory);facade.setupInputs(),facade.bootstrapNg2(projectableNodes),facade.setupOutputs(),facade.registerCleanup(),injectorPromise.resolve(facade.componentRef.injector)}var id=idPrefix+idCount++;element[0].id=id;var injectorPromise=new ParentInjectorPromise(element),ng2Compiler=ng1Injector.get(NG2_COMPILER),ngContentSelectors=ng2Compiler.getNgContentSelectors(info.type),linkFns=compileProjectedNodes(templateElement,ngContentSelectors),componentFactory=componentFactoryRefMap[info.selector];if(!componentFactory)throw new Error("Expecting ComponentFactory for: "+info.selector);element.empty();var projectableNodes=linkFns.map(function(link){var projectedClone;return link(scope,function(clone){projectedClone=clone,element.append(clone)}),projectedClone});parentInjector=parentInjector||ng1Injector.get(NG2_INJECTOR),parentInjector instanceof ParentInjectorPromise?parentInjector.then(function(resolvedInjector){return downgrade(resolvedInjector)}):downgrade(parentInjector)}}}}}return directiveFactory.$inject=[NG1_INJECTOR,NG1_COMPILE,NG2_COMPONENT_FACTORY_REF_MAP,NG1_PARSE],directiveFactory}function sortProjectableNodes(ngContentSelectors,childNodes){for(var wildcardNgContentIndex,projectableNodes=[],matcher=new _angular_compiler.SelectorMatcher,i=0,ii=ngContentSelectors.length;i<ii;i++)projectableNodes[i]=[],"*"===ngContentSelectors[i]?wildcardNgContentIndex=i:matcher.addSelectables(_angular_compiler.CssSelector.parse(ngContentSelectors[i]),i);for(var _loop_1=function(node){var ngContentIndices=[],selector=_angular_compiler.createElementCssSelector(node.nodeName.toLowerCase(),getAttributesAsArray(node));matcher.match(selector,function(selector,ngContentIndex){ngContentIndices.push(ngContentIndex)}),ngContentIndices.sort(),void 0!==wildcardNgContentIndex&&ngContentIndices.push(wildcardNgContentIndex),ngContentIndices.length>0&&projectableNodes[ngContentIndices[0]].push(node)},_i=0,childNodes_1=childNodes;_i<childNodes_1.length;_i++){var node=childNodes_1[_i];_loop_1(node)}return projectableNodes}var angular={bootstrap:noNg,module:noNg,element:noNg,version:noNg,resumeBootstrap:noNg,getTestability:noNg};try{window.hasOwnProperty("angular")&&(angular=window.angular)}catch(e){}var bootstrap=angular.bootstrap,module$1=angular.module,element=angular.element,NG2_COMPILER="ng2.Compiler",NG2_INJECTOR="ng2.Injector",NG2_COMPONENT_FACTORY_REF_MAP="ng2.ComponentFactoryRefMap",NG2_ZONE="ng2.NgZone",NG1_CONTROLLER="$controller",NG1_SCOPE="$scope",NG1_ROOT_SCOPE="$rootScope",NG1_COMPILE="$compile",NG1_HTTP_BACKEND="$httpBackend",NG1_INJECTOR="$injector",NG1_PARSE="$parse",NG1_TEMPLATE_CACHE="$templateCache",NG1_TESTABILITY="$$testability",REQUIRE_INJECTOR="?^^"+NG2_INJECTOR,INITIAL_VALUE={__UNINITIALIZED__:!0},DowngradeNg2ComponentAdapter=function(){function DowngradeNg2ComponentAdapter(info,element,attrs,scope,parentInjector,parse,componentFactory){this.info=info,this.element=element,this.attrs=attrs,this.scope=scope,this.parentInjector=parentInjector,this.parse=parse,this.componentFactory=componentFactory,this.component=null,this.inputChangeCount=0,this.inputChanges=null,this.componentRef=null,this.changeDetector=null,this.componentScope=scope.$new()}return DowngradeNg2ComponentAdapter.prototype.bootstrapNg2=function(projectableNodes){var childInjector=_angular_core.ReflectiveInjector.resolveAndCreate([{provide:NG1_SCOPE,useValue:this.componentScope}],this.parentInjector);this.componentRef=this.componentFactory.create(childInjector,projectableNodes,this.element[0]),this.changeDetector=this.componentRef.changeDetectorRef,this.component=this.componentRef.instance},DowngradeNg2ComponentAdapter.prototype.setupInputs=function(){for(var _this=this,attrs=this.attrs,inputs=this.info.inputs||[],i=0;i<inputs.length;i++){var input=inputs[i],expr=null;if(attrs.hasOwnProperty(input.attr)){var observeFn=function(prop){var prevValue=INITIAL_VALUE;return function(value){null!==_this.inputChanges&&(_this.inputChangeCount++,_this.inputChanges[prop]=new _angular_core.SimpleChange(value,prevValue===INITIAL_VALUE?value:prevValue,prevValue===INITIAL_VALUE),prevValue=value),_this.component[prop]=value}}(input.prop);attrs.$observe(input.attr,observeFn)}else attrs.hasOwnProperty(input.bindAttr)?expr=attrs[input.bindAttr]:attrs.hasOwnProperty(input.bracketAttr)?expr=attrs[input.bracketAttr]:attrs.hasOwnProperty(input.bindonAttr)?expr=attrs[input.bindonAttr]:attrs.hasOwnProperty(input.bracketParenAttr)&&(expr=attrs[input.bracketParenAttr]);if(null!=expr){var watchFn=function(prop){return function(value,prevValue){null!=_this.inputChanges&&(_this.inputChangeCount++,_this.inputChanges[prop]=new _angular_core.SimpleChange(prevValue,value,prevValue===value)),_this.component[prop]=value}}(input.prop);this.componentScope.$watch(expr,watchFn)}}var prototype=this.info.type.prototype;prototype&&prototype.ngOnChanges&&(this.inputChanges={},this.componentScope.$watch(function(){return _this.inputChangeCount},function(){var inputChanges=_this.inputChanges;_this.inputChanges={},_this.component.ngOnChanges(inputChanges)})),this.componentScope.$watch(function(){return _this.changeDetector&&_this.changeDetector.detectChanges()})},DowngradeNg2ComponentAdapter.prototype.setupOutputs=function(){for(var _this=this,attrs=this.attrs,outputs=this.info.outputs||[],j=0;j<outputs.length;j++){var output=outputs[j],expr=null,assignExpr=!1,bindonAttr=output.bindonAttr?output.bindonAttr.substring(0,output.bindonAttr.length-6):null,bracketParenAttr=output.bracketParenAttr?"[("+output.bracketParenAttr.substring(2,output.bracketParenAttr.length-8)+")]":null;if(attrs.hasOwnProperty(output.onAttr)?expr=attrs[output.onAttr]:attrs.hasOwnProperty(output.parenAttr)?expr=attrs[output.parenAttr]:attrs.hasOwnProperty(bindonAttr)?(expr=attrs[bindonAttr],assignExpr=!0):attrs.hasOwnProperty(bracketParenAttr)&&(expr=attrs[bracketParenAttr],assignExpr=!0),null!=expr&&null!=assignExpr){var getter=this.parse(expr),setter=getter.assign;if(assignExpr&&!setter)throw new Error("Expression '"+expr+"' is not assignable!");var emitter=this.component[output.prop];if(!emitter)throw new Error("Missing emitter '"+output.prop+"' on component '"+this.info.selector+"'!");emitter.subscribe({next:assignExpr?function(setter){return function(v){return setter(_this.scope,v)}}(setter):function(getter){return function(v){return getter(_this.scope,{$event:v})}}(getter)})}}},DowngradeNg2ComponentAdapter.prototype.registerCleanup=function(){var _this=this;this.element.bind("$destroy",function(){_this.componentScope.$destroy(),_this.componentRef.destroy()})},DowngradeNg2ComponentAdapter}(),COMPONENT_SELECTOR=/^[\w|-]*$/,SKEWER_CASE=/-(\w)/g,directiveResolver=new _angular_compiler.DirectiveResolver,Deferred=function(){function Deferred(){var _this=this;this.promise=new Promise(function(res,rej){_this.resolve=res,_this.reject=rej})}return Deferred}(),CAMEL_CASE=/([A-Z])/g,INITIAL_VALUE$1={__UNINITIALIZED__:!0},NOT_SUPPORTED="NOT_SUPPORTED",UpgradeNg1ComponentAdapterBuilder=function(){function UpgradeNg1ComponentAdapterBuilder(name){this.name=name,this.inputs=[],this.inputsRename=[],this.outputs=[],this.outputsRename=[],this.propertyOutputs=[],this.checkProperties=[],this.propertyMap={},this.linkFn=null,this.directive=null,this.$controller=null;var selector=name.replace(CAMEL_CASE,function(all,next){return"-"+next.toLowerCase()}),self=this;this.type=_angular_core.Directive({selector:selector,inputs:this.inputsRename,outputs:this.outputsRename}).Class({constructor:[new _angular_core.Inject(NG1_SCOPE),_angular_core.ElementRef,function(scope,elementRef){return new UpgradeNg1ComponentAdapter(self.linkFn,scope,self.directive,elementRef,self.$controller,self.inputs,self.outputs,self.propertyOutputs,self.checkProperties,self.propertyMap)}],ngOnInit:function(){},ngOnChanges:function(){},ngDoCheck:function(){},ngOnDestroy:function(){}})}return UpgradeNg1ComponentAdapterBuilder.prototype.extractDirective=function(injector){var directives=injector.get(this.name+"Directive");if(directives.length>1)throw new Error("Only support single directive definition for: "+this.name);var directive=directives[0];directive.replace&&this.notSupported("replace"),directive.terminal&&this.notSupported("terminal");var link=directive.link;return"object"==typeof link&&link.post&&this.notSupported("link.post"),directive},UpgradeNg1ComponentAdapterBuilder.prototype.notSupported=function(feature){throw new Error("Upgraded directive '"+this.name+"' does not support '"+feature+"'.")},UpgradeNg1ComponentAdapterBuilder.prototype.extractBindings=function(){var btcIsObject="object"==typeof this.directive.bindToController;if(btcIsObject&&Object.keys(this.directive.scope).length)throw new Error("Binding definitions on scope and controller at the same time are not supported.");var context=btcIsObject?this.directive.bindToController:this.directive.scope;if("object"==typeof context)for(var name_1 in context)if(context.hasOwnProperty(name_1)){var localName=context[name_1],type=localName.charAt(0),typeOptions=localName.charAt(1);localName="?"===typeOptions?localName.substr(2):localName.substr(1),localName=localName||name_1;var outputName="output_"+name_1,outputNameRename=outputName+": "+name_1,outputNameRenameChange=outputName+": "+name_1+"Change",inputName="input_"+name_1,inputNameRename=inputName+": "+name_1;switch(type){case"=":this.propertyOutputs.push(outputName),this.checkProperties.push(localName),this.outputs.push(outputName),this.outputsRename.push(outputNameRenameChange),this.propertyMap[outputName]=localName,this.inputs.push(inputName),this.inputsRename.push(inputNameRename),this.propertyMap[inputName]=localName;break;case"@":case"<":this.inputs.push(inputName),this.inputsRename.push(inputNameRename),this.propertyMap[inputName]=localName;break;case"&":this.outputs.push(outputName),this.outputsRename.push(outputNameRename),this.propertyMap[outputName]=localName;break;default:var json=JSON.stringify(context);throw new Error("Unexpected mapping '"+type+"' in '"+json+"' in '"+this.name+"' directive.")}}},UpgradeNg1ComponentAdapterBuilder.prototype.compileTemplate=function(compile,templateCache,httpBackend){function compileHtml(html){var div=document.createElement("div");return div.innerHTML=html,compile(div.childNodes)}var _this=this;if(void 0!==this.directive.template)this.linkFn=compileHtml(isFunction(this.directive.template)?this.directive.template():this.directive.template);else{if(!this.directive.templateUrl)throw new Error("Directive '"+this.name+"' is not a component, it is missing template.");var url_1=isFunction(this.directive.templateUrl)?this.directive.templateUrl():this.directive.templateUrl,html=templateCache.get(url_1);if(void 0===html)return new Promise(function(resolve,err){httpBackend("GET",url_1,null,function(status,response){200==status?resolve(_this.linkFn=compileHtml(templateCache.put(url_1,response))):err("GET "+url_1+" returned "+status+": "+response)})});this.linkFn=compileHtml(html)}return null},UpgradeNg1ComponentAdapterBuilder.resolve=function(exportedComponents,injector){var promises=[],compile=injector.get(NG1_COMPILE),templateCache=injector.get(NG1_TEMPLATE_CACHE),httpBackend=injector.get(NG1_HTTP_BACKEND),$controller=injector.get(NG1_CONTROLLER);for(var name_2 in exportedComponents)if(exportedComponents.hasOwnProperty(name_2)){var exportedComponent=exportedComponents[name_2];exportedComponent.directive=exportedComponent.extractDirective(injector),exportedComponent.$controller=$controller,exportedComponent.extractBindings();var promise=exportedComponent.compileTemplate(compile,templateCache,httpBackend);promise&&promises.push(promise)}return Promise.all(promises)},UpgradeNg1ComponentAdapterBuilder}(),UpgradeNg1ComponentAdapter=function(){function UpgradeNg1ComponentAdapter(linkFn,scope,directive,elementRef,$controller,inputs,outputs,propOuts,checkProperties,propertyMap){this.linkFn=linkFn,this.directive=directive,this.$controller=$controller,this.inputs=inputs,this.outputs=outputs,this.propOuts=propOuts,this.checkProperties=checkProperties,this.propertyMap=propertyMap,this.controllerInstance=null,this.destinationObj=null,this.checkLastValues=[],this.$element=null,this.element=elementRef.nativeElement,this.componentScope=scope.$new(!!directive.scope),this.$element=element(this.element);var controllerType=directive.controller;directive.bindToController&&controllerType?(this.controllerInstance=this.buildController(controllerType),this.destinationObj=this.controllerInstance):this.destinationObj=this.componentScope;for(var i=0;i<inputs.length;i++)this[inputs[i]]=null;for(var j=0;j<outputs.length;j++){var emitter=this[outputs[j]]=new _angular_core.EventEmitter;this.setComponentProperty(outputs[j],function(emitter){return function(value){return emitter.emit(value)}}(emitter))}for(var k=0;k<propOuts.length;k++)this[propOuts[k]]=new _angular_core.EventEmitter,this.checkLastValues.push(INITIAL_VALUE$1)}return UpgradeNg1ComponentAdapter.prototype.ngOnInit=function(){var _this=this;!this.directive.bindToController&&this.directive.controller&&(this.controllerInstance=this.buildController(this.directive.controller)),this.controllerInstance&&isFunction(this.controllerInstance.$onInit)&&this.controllerInstance.$onInit();var link=this.directive.link;if("object"==typeof link&&(link=link.pre),link){var attrs=NOT_SUPPORTED,transcludeFn=NOT_SUPPORTED,linkController=this.resolveRequired(this.$element,this.directive.require);this.directive.link(this.componentScope,this.$element,attrs,linkController,transcludeFn)}for(var childNode,childNodes=[];childNode=this.element.firstChild;)this.element.removeChild(childNode),childNodes.push(childNode);this.linkFn(this.componentScope,function(clonedElement,scope){for(var i=0,ii=clonedElement.length;i<ii;i++)_this.element.appendChild(clonedElement[i])},{parentBoundTranscludeFn:function(scope,cloneAttach){cloneAttach(childNodes)}}),this.controllerInstance&&isFunction(this.controllerInstance.$postLink)&&this.controllerInstance.$postLink()},UpgradeNg1ComponentAdapter.prototype.ngOnChanges=function(changes){var _this=this,ng1Changes={};Object.keys(changes).forEach(function(name){var change=changes[name];_this.setComponentProperty(name,change.currentValue),ng1Changes[_this.propertyMap[name]]=change}),isFunction(this.destinationObj.$onChanges)&&this.destinationObj.$onChanges(ng1Changes)},UpgradeNg1ComponentAdapter.prototype.ngDoCheck=function(){for(var destinationObj=this.destinationObj,lastValues=this.checkLastValues,checkProperties=this.checkProperties,i=0;i<checkProperties.length;i++){var value=destinationObj[checkProperties[i]],last=lastValues[i];if(value!==last)if("number"==typeof value&&isNaN(value)&&"number"==typeof last&&isNaN(last));else{var eventEmitter=this[this.propOuts[i]];eventEmitter.emit(lastValues[i]=value)}}this.controllerInstance&&isFunction(this.controllerInstance.$doCheck)&&this.controllerInstance.$doCheck()},UpgradeNg1ComponentAdapter.prototype.ngOnDestroy=function(){this.controllerInstance&&isFunction(this.controllerInstance.$onDestroy)&&this.controllerInstance.$onDestroy()},UpgradeNg1ComponentAdapter.prototype.setComponentProperty=function(name,value){this.destinationObj[this.propertyMap[name]]=value},UpgradeNg1ComponentAdapter.prototype.buildController=function(controllerType){var locals={$scope:this.componentScope,$element:this.$element},controller=this.$controller(controllerType,locals,null,this.directive.controllerAs);return this.$element.data(controllerKey(this.directive.name),controller),controller},UpgradeNg1ComponentAdapter.prototype.resolveRequired=function($element,require){if(require){if("string"==typeof require){var name_3=require,isOptional=!1,startParent=!1,searchParents=!1;"?"==name_3.charAt(0)&&(isOptional=!0,name_3=name_3.substr(1)),"^"==name_3.charAt(0)&&(searchParents=!0,name_3=name_3.substr(1)),"^"==name_3.charAt(0)&&(startParent=!0,name_3=name_3.substr(1));var key=controllerKey(name_3);startParent&&($element=$element.parent());var dep=searchParents?$element.inheritedData(key):$element.data(key);if(!dep&&!isOptional)throw new Error("Can not locate '"+require+"' in '"+this.directive.name+"'.");return dep}if(require instanceof Array){for(var deps=[],i=0;i<require.length;i++)deps.push(this.resolveRequired($element,require[i]));return deps}throw new Error("Directive '"+this.directive.name+"' require syntax unrecognized: "+this.directive.require)}},UpgradeNg1ComponentAdapter}(),upgradeCount=0,UpgradeAdapter=function(){function UpgradeAdapter(ng2AppModule,compilerOptions){if(this.ng2AppModule=ng2AppModule,this.compilerOptions=compilerOptions,this.idPrefix="NG2_UPGRADE_"+upgradeCount++ +"_",this.upgradedComponents=[],this.ng1ComponentsToBeUpgraded={},this.providers=[],this.moduleRef=null,!ng2AppModule)throw new Error("UpgradeAdapter cannot be instantiated without an NgModule of the Angular 2 app.")}return UpgradeAdapter.prototype.downgradeNg2Component=function(type){this.upgradedComponents.push(type);var info=getComponentInfo(type);return ng1ComponentDirective(info,""+this.idPrefix+info.selector+"_c")},UpgradeAdapter.prototype.upgradeNg1Component=function(name){return this.ng1ComponentsToBeUpgraded.hasOwnProperty(name)?this.ng1ComponentsToBeUpgraded[name].type:(this.ng1ComponentsToBeUpgraded[name]=new UpgradeNg1ComponentAdapterBuilder(name)).type},UpgradeAdapter.prototype.registerForNg1Tests=function(modules){var _this=this,windowNgMock=window.angular.mock;if(!windowNgMock||!windowNgMock.module)throw new Error("Failed to find 'angular.mock.module'.");this.declareNg1Module(modules),windowNgMock.module(this.ng1Module.name);var upgrade=new UpgradeAdapterRef;return this.ng2BootstrapDeferred.promise.then(function(ng1Injector){upgrade._bootstrapDone(_this.moduleRef,ng1Injector)},onError),upgrade},UpgradeAdapter.prototype.bootstrap=function(element$$,modules,config){var _this=this;this.declareNg1Module(modules);var upgrade=new UpgradeAdapterRef,windowAngular=window.angular;windowAngular.resumeBootstrap=void 0,this.ngZone.run(function(){bootstrap(element$$,[_this.ng1Module.name],config)});var ng1BootstrapPromise=new Promise(function(resolve){if(windowAngular.resumeBootstrap){var originalResumeBootstrap_1=windowAngular.resumeBootstrap;windowAngular.resumeBootstrap=function(){windowAngular.resumeBootstrap=originalResumeBootstrap_1,windowAngular.resumeBootstrap.apply(this,arguments),resolve()}}else resolve()});return Promise.all([this.ng2BootstrapDeferred.promise,ng1BootstrapPromise]).then(function(_a){var ng1Injector=_a[0];element(element$$).data(controllerKey(NG2_INJECTOR),_this.moduleRef.injector),_this.moduleRef.injector.get(_angular_core.NgZone).run(function(){upgrade._bootstrapDone(_this.moduleRef,ng1Injector)})},onError),upgrade},UpgradeAdapter.prototype.upgradeNg1Provider=function(name,options){var token=options&&options.asToken||name;this.providers.push({provide:token,useFactory:function(ng1Injector){return ng1Injector.get(name)},deps:[NG1_INJECTOR]})},UpgradeAdapter.prototype.downgradeNg2Provider=function(token){var factory=function(injector){return injector.get(token)};return factory.$inject=[NG2_INJECTOR],factory},UpgradeAdapter.prototype.declareNg1Module=function(modules){var _this=this;void 0===modules&&(modules=[]);var original$applyFn,rootScopePrototype,rootScope,delayApplyExps=[],componentFactoryRefMap={},upgradeAdapter=this,ng1Module=this.ng1Module=module$1(this.idPrefix,modules),platformRef=_angular_platformBrowserDynamic.platformBrowserDynamic();return this.ngZone=new _angular_core.NgZone({enableLongStackTrace:Zone.hasOwnProperty("longStackTraceZoneSpec")}),this.ng2BootstrapDeferred=new Deferred,ng1Module.factory(NG2_INJECTOR,function(){return _this.moduleRef.injector.get(_angular_core.Injector)}).constant(NG2_ZONE,this.ngZone).constant(NG2_COMPONENT_FACTORY_REF_MAP,componentFactoryRefMap).factory(NG2_COMPILER,function(){return _this.moduleRef.injector.get(_angular_core.Compiler)}).config(["$provide","$injector",function(provide,ng1Injector){provide.decorator(NG1_ROOT_SCOPE,["$delegate",function(rootScopeDelegate){if(rootScopePrototype=rootScopeDelegate.constructor.prototype,!rootScopePrototype.hasOwnProperty("$apply"))throw new Error("Failed to find '$apply' on '$rootScope'!");return original$applyFn=rootScopePrototype.$apply,rootScopePrototype.$apply=function(exp){return delayApplyExps.push(exp)},rootScope=rootScopeDelegate}]),ng1Injector.has(NG1_TESTABILITY)&&provide.decorator(NG1_TESTABILITY,["$delegate",function(testabilityDelegate){var originalWhenStable=testabilityDelegate.whenStable,newWhenStable=function(callback){originalWhenStable.call(this,function(){var ng2Testability=upgradeAdapter.moduleRef.injector.get(_angular_core.Testability);ng2Testability.isStable()?callback.apply(this,arguments):ng2Testability.whenStable(newWhenStable.bind(this,callback))})};return testabilityDelegate.whenStable=newWhenStable,testabilityDelegate}])}]),ng1Module.run(["$injector","$rootScope",function(ng1Injector,rootScope){UpgradeNg1ComponentAdapterBuilder.resolve(_this.ng1ComponentsToBeUpgraded,ng1Injector).then(function(){var DynamicNgUpgradeModule=_angular_core.NgModule({providers:[{provide:NG1_INJECTOR,useFactory:function(){return ng1Injector}},{provide:NG1_COMPILE,useFactory:function(){return ng1Injector.get(NG1_COMPILE)}},_this.providers],imports:[_this.ng2AppModule]}).Class({constructor:function(){},ngDoBootstrap:function(){}});platformRef._bootstrapModuleWithZone(DynamicNgUpgradeModule,_this.compilerOptions,_this.ngZone,function(componentFactories){componentFactories.forEach(function(componentFactory){var type=componentFactory.componentType;_this.upgradedComponents.indexOf(type)!==-1&&(componentFactoryRefMap[getComponentInfo(type).selector]=componentFactory)})}).then(function(ref){_this.moduleRef=ref;var subscription=_this.ngZone.onMicrotaskEmpty.subscribe({next:function(_){return _this.ngZone.runOutsideAngular(function(){return rootScope.$evalAsync()})}});rootScope.$on("$destroy",function(){subscription.unsubscribe()}),_this.ngZone.run(function(){if(rootScopePrototype){for(rootScopePrototype.$apply=original$applyFn;delayApplyExps.length;)rootScope.$apply(delayApplyExps.shift());rootScopePrototype=null}})}).then(function(){return _this.ng2BootstrapDeferred.resolve(ng1Injector)},onError)}).catch(function(e){return _this.ng2BootstrapDeferred.reject(e)})}]),ng1Module},UpgradeAdapter}(),ParentInjectorPromise=function(){function ParentInjectorPromise(element){this.element=element,this.callbacks=[],element.data(controllerKey(NG2_INJECTOR),this)}return ParentInjectorPromise.prototype.then=function(callback){this.injector?callback(this.injector):this.callbacks.push(callback)},ParentInjectorPromise.prototype.resolve=function(injector){this.injector=injector,this.element.data(controllerKey(NG2_INJECTOR),injector),this.element=null,this.callbacks.forEach(function(callback){return callback(injector)}),this.callbacks.length=0},ParentInjectorPromise}(),UpgradeAdapterRef=function(){function UpgradeAdapterRef(){this._readyFn=null,this.ng1RootScope=null,this.ng1Injector=null,this.ng2ModuleRef=null,this.ng2Injector=null}return UpgradeAdapterRef.prototype._bootstrapDone=function(ngModuleRef,ng1Injector){this.ng2ModuleRef=ngModuleRef,this.ng2Injector=ngModuleRef.injector,this.ng1Injector=ng1Injector,this.ng1RootScope=ng1Injector.get(NG1_ROOT_SCOPE),this._readyFn&&this._readyFn(this)},UpgradeAdapterRef.prototype.ready=function(fn){this._readyFn=fn},UpgradeAdapterRef.prototype.dispose=function(){this.ng1Injector.get(NG1_ROOT_SCOPE).$destroy(),this.ng2ModuleRef.destroy()},UpgradeAdapterRef}(),VERSION=new _angular_core.Version("4.0.0-beta.3");exports.UpgradeAdapter=UpgradeAdapter,exports.UpgradeAdapterRef=UpgradeAdapterRef,exports.VERSION=VERSION});
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
* @param {?} e
* @return {?}
*/
function onError(e){throw console.error?console.error(e,e.stack):console.log(e,e.stack),e}function controllerKey(name){return"$"+name+"Controller"}function getAttributesAsArray(node){var asArray,attributes=node.attributes;if(attributes){var attrLen=attributes.length;asArray=new Array(attrLen);for(var i=0;i<attrLen;i++)asArray[i]=[attributes[i].nodeName,attributes[i].nodeValue]}return asArray||[]}function isFunction(value){return"function"==typeof value}function ng1ComponentDirective(info,idPrefix){function directiveFactory(ng1Injector,ng1Compile,componentFactoryRefMap,parse){function compileProjectedNodes(templateElement,ngContentSelectors){if(!ngContentSelectors)throw new Error("Expecting ngContentSelectors for: "+info.selector);var projectableTemplateNodes=sortProjectableNodes(ngContentSelectors,templateElement.contents());return projectableTemplateNodes.map(function(nodes){return ng1Compile(nodes)})}var idCount=0;info.selector.replace(/[A-Z]/g,function(char){return"-"+char.toLowerCase()});return{restrict:"E",terminal:!0,require:REQUIRE_INJECTOR,compile:function(templateElement,templateAttributes,transclude){return{post:function(scope,element,attrs,parentInjector,transclude){function downgrade(injector){var facade=new DowngradeNg2ComponentAdapter(info,element,attrs,scope,injector,parse,componentFactory);facade.setupInputs(),facade.bootstrapNg2(projectableNodes),facade.setupOutputs(),facade.registerCleanup(),injectorPromise.resolve(facade.componentRef.injector)}var id=idPrefix+idCount++;element[0].id=id;var injectorPromise=new ParentInjectorPromise(element),ng2Compiler=ng1Injector.get(NG2_COMPILER),ngContentSelectors=ng2Compiler.getNgContentSelectors(info.type),linkFns=compileProjectedNodes(templateElement,ngContentSelectors),componentFactory=componentFactoryRefMap[info.selector];if(!componentFactory)throw new Error("Expecting ComponentFactory for: "+info.selector);element.empty();var projectableNodes=linkFns.map(function(link){var projectedClone;return link(scope,function(clone){projectedClone=clone,element.append(clone)}),projectedClone});parentInjector=parentInjector||ng1Injector.get(NG2_INJECTOR),parentInjector instanceof ParentInjectorPromise?parentInjector.then(function(resolvedInjector){return downgrade(resolvedInjector)}):downgrade(parentInjector)}}}}}return directiveFactory.$inject=[NG1_INJECTOR,NG1_COMPILE,NG2_COMPONENT_FACTORY_REF_MAP,NG1_PARSE],directiveFactory}function sortProjectableNodes(ngContentSelectors,childNodes){for(var wildcardNgContentIndex,projectableNodes=[],matcher=new _angular_compiler.SelectorMatcher,i=0,ii=ngContentSelectors.length;i<ii;i++)projectableNodes[i]=[],"*"===ngContentSelectors[i]?wildcardNgContentIndex=i:matcher.addSelectables(_angular_compiler.CssSelector.parse(ngContentSelectors[i]),i);for(var _loop_1=function(node){var ngContentIndices=[],selector=_angular_compiler.createElementCssSelector(node.nodeName.toLowerCase(),getAttributesAsArray(node));matcher.match(selector,function(selector,ngContentIndex){ngContentIndices.push(ngContentIndex)}),ngContentIndices.sort(),void 0!==wildcardNgContentIndex&&ngContentIndices.push(wildcardNgContentIndex),ngContentIndices.length>0&&projectableNodes[ngContentIndices[0]].push(node)},_i=0,childNodes_1=childNodes;_i<childNodes_1.length;_i++){var node=childNodes_1[_i];_loop_1(node)}return projectableNodes}var angular={bootstrap:noNg,module:noNg,element:noNg,version:noNg,resumeBootstrap:noNg,getTestability:noNg};try{window.hasOwnProperty("angular")&&(angular=window.angular)}catch(e){}var bootstrap=angular.bootstrap,module$1=angular.module,element=angular.element,NG2_COMPILER="ng2.Compiler",NG2_INJECTOR="ng2.Injector",NG2_COMPONENT_FACTORY_REF_MAP="ng2.ComponentFactoryRefMap",NG2_ZONE="ng2.NgZone",NG1_CONTROLLER="$controller",NG1_SCOPE="$scope",NG1_ROOT_SCOPE="$rootScope",NG1_COMPILE="$compile",NG1_HTTP_BACKEND="$httpBackend",NG1_INJECTOR="$injector",NG1_PARSE="$parse",NG1_TEMPLATE_CACHE="$templateCache",NG1_TESTABILITY="$$testability",REQUIRE_INJECTOR="?^^"+NG2_INJECTOR,INITIAL_VALUE={__UNINITIALIZED__:!0},DowngradeNg2ComponentAdapter=function(){function DowngradeNg2ComponentAdapter(info,element,attrs,scope,parentInjector,parse,componentFactory){this.info=info,this.element=element,this.attrs=attrs,this.scope=scope,this.parentInjector=parentInjector,this.parse=parse,this.componentFactory=componentFactory,this.component=null,this.inputChangeCount=0,this.inputChanges=null,this.componentRef=null,this.changeDetector=null,this.componentScope=scope.$new()}return DowngradeNg2ComponentAdapter.prototype.bootstrapNg2=function(projectableNodes){var childInjector=_angular_core.ReflectiveInjector.resolveAndCreate([{provide:NG1_SCOPE,useValue:this.componentScope}],this.parentInjector);this.componentRef=this.componentFactory.create(childInjector,projectableNodes,this.element[0]),this.changeDetector=this.componentRef.changeDetectorRef,this.component=this.componentRef.instance},DowngradeNg2ComponentAdapter.prototype.setupInputs=function(){for(var _this=this,attrs=this.attrs,inputs=this.info.inputs||[],i=0;i<inputs.length;i++){var input=inputs[i],expr=null;if(attrs.hasOwnProperty(input.attr)){var observeFn=function(prop){var prevValue=INITIAL_VALUE;return function(value){null!==_this.inputChanges&&(_this.inputChangeCount++,_this.inputChanges[prop]=new _angular_core.SimpleChange(value,prevValue===INITIAL_VALUE?value:prevValue,prevValue===INITIAL_VALUE),prevValue=value),_this.component[prop]=value}}(input.prop);attrs.$observe(input.attr,observeFn)}else attrs.hasOwnProperty(input.bindAttr)?expr=attrs[input.bindAttr]:attrs.hasOwnProperty(input.bracketAttr)?expr=attrs[input.bracketAttr]:attrs.hasOwnProperty(input.bindonAttr)?expr=attrs[input.bindonAttr]:attrs.hasOwnProperty(input.bracketParenAttr)&&(expr=attrs[input.bracketParenAttr]);if(null!=expr){var watchFn=function(prop){return function(value,prevValue){null!=_this.inputChanges&&(_this.inputChangeCount++,_this.inputChanges[prop]=new _angular_core.SimpleChange(prevValue,value,prevValue===value)),_this.component[prop]=value}}(input.prop);this.componentScope.$watch(expr,watchFn)}}var prototype=this.info.type.prototype;prototype&&prototype.ngOnChanges&&(this.inputChanges={},this.componentScope.$watch(function(){return _this.inputChangeCount},function(){var inputChanges=_this.inputChanges;_this.inputChanges={},_this.component.ngOnChanges(inputChanges)})),this.componentScope.$watch(function(){return _this.changeDetector&&_this.changeDetector.detectChanges()})},DowngradeNg2ComponentAdapter.prototype.setupOutputs=function(){for(var _this=this,attrs=this.attrs,outputs=this.info.outputs||[],j=0;j<outputs.length;j++){var output=outputs[j],expr=null,assignExpr=!1,bindonAttr=output.bindonAttr?output.bindonAttr.substring(0,output.bindonAttr.length-6):null,bracketParenAttr=output.bracketParenAttr?"[("+output.bracketParenAttr.substring(2,output.bracketParenAttr.length-8)+")]":null;if(attrs.hasOwnProperty(output.onAttr)?expr=attrs[output.onAttr]:attrs.hasOwnProperty(output.parenAttr)?expr=attrs[output.parenAttr]:attrs.hasOwnProperty(bindonAttr)?(expr=attrs[bindonAttr],assignExpr=!0):attrs.hasOwnProperty(bracketParenAttr)&&(expr=attrs[bracketParenAttr],assignExpr=!0),null!=expr&&null!=assignExpr){var getter=this.parse(expr),setter=getter.assign;if(assignExpr&&!setter)throw new Error("Expression '"+expr+"' is not assignable!");var emitter=this.component[output.prop];if(!emitter)throw new Error("Missing emitter '"+output.prop+"' on component '"+this.info.selector+"'!");emitter.subscribe({next:assignExpr?function(setter){return function(v){return setter(_this.scope,v)}}(setter):function(getter){return function(v){return getter(_this.scope,{$event:v})}}(getter)})}}},DowngradeNg2ComponentAdapter.prototype.registerCleanup=function(){var _this=this;this.element.bind("$destroy",function(){_this.componentScope.$destroy(),_this.componentRef.destroy()})},DowngradeNg2ComponentAdapter}(),COMPONENT_SELECTOR=/^[\w|-]*$/,SKEWER_CASE=/-(\w)/g,directiveResolver=new _angular_compiler.DirectiveResolver,Deferred=function(){function Deferred(){var _this=this;this.promise=new Promise(function(res,rej){_this.resolve=res,_this.reject=rej})}return Deferred}(),CAMEL_CASE=/([A-Z])/g,INITIAL_VALUE$1={__UNINITIALIZED__:!0},NOT_SUPPORTED="NOT_SUPPORTED",UpgradeNg1ComponentAdapterBuilder=function(){function UpgradeNg1ComponentAdapterBuilder(name){this.name=name,this.inputs=[],this.inputsRename=[],this.outputs=[],this.outputsRename=[],this.propertyOutputs=[],this.checkProperties=[],this.propertyMap={},this.linkFn=null,this.directive=null,this.$controller=null;var selector=name.replace(CAMEL_CASE,function(all,next){return"-"+next.toLowerCase()}),self=this;this.type=_angular_core.Directive({selector:selector,inputs:this.inputsRename,outputs:this.outputsRename}).Class({constructor:[new _angular_core.Inject(NG1_SCOPE),_angular_core.ElementRef,function(scope,elementRef){return new UpgradeNg1ComponentAdapter(self.linkFn,scope,self.directive,elementRef,self.$controller,self.inputs,self.outputs,self.propertyOutputs,self.checkProperties,self.propertyMap)}],ngOnInit:function(){},ngOnChanges:function(){},ngDoCheck:function(){},ngOnDestroy:function(){}})}return UpgradeNg1ComponentAdapterBuilder.prototype.extractDirective=function(injector){var directives=injector.get(this.name+"Directive");if(directives.length>1)throw new Error("Only support single directive definition for: "+this.name);var directive=directives[0];directive.replace&&this.notSupported("replace"),directive.terminal&&this.notSupported("terminal");var link=directive.link;return"object"==typeof link&&link.post&&this.notSupported("link.post"),directive},UpgradeNg1ComponentAdapterBuilder.prototype.notSupported=function(feature){throw new Error("Upgraded directive '"+this.name+"' does not support '"+feature+"'.")},UpgradeNg1ComponentAdapterBuilder.prototype.extractBindings=function(){var btcIsObject="object"==typeof this.directive.bindToController;if(btcIsObject&&Object.keys(this.directive.scope).length)throw new Error("Binding definitions on scope and controller at the same time are not supported.");var context=btcIsObject?this.directive.bindToController:this.directive.scope;if("object"==typeof context)for(var name_1 in context)if(context.hasOwnProperty(name_1)){var localName=context[name_1],type=localName.charAt(0),typeOptions=localName.charAt(1);localName="?"===typeOptions?localName.substr(2):localName.substr(1),localName=localName||name_1;var outputName="output_"+name_1,outputNameRename=outputName+": "+name_1,outputNameRenameChange=outputName+": "+name_1+"Change",inputName="input_"+name_1,inputNameRename=inputName+": "+name_1;switch(type){case"=":this.propertyOutputs.push(outputName),this.checkProperties.push(localName),this.outputs.push(outputName),this.outputsRename.push(outputNameRenameChange),this.propertyMap[outputName]=localName,this.inputs.push(inputName),this.inputsRename.push(inputNameRename),this.propertyMap[inputName]=localName;break;case"@":case"<":this.inputs.push(inputName),this.inputsRename.push(inputNameRename),this.propertyMap[inputName]=localName;break;case"&":this.outputs.push(outputName),this.outputsRename.push(outputNameRename),this.propertyMap[outputName]=localName;break;default:var json=JSON.stringify(context);throw new Error("Unexpected mapping '"+type+"' in '"+json+"' in '"+this.name+"' directive.")}}},UpgradeNg1ComponentAdapterBuilder.prototype.compileTemplate=function(compile,templateCache,httpBackend){function compileHtml(html){var div=document.createElement("div");return div.innerHTML=html,compile(div.childNodes)}var _this=this;if(void 0!==this.directive.template)this.linkFn=compileHtml(isFunction(this.directive.template)?this.directive.template():this.directive.template);else{if(!this.directive.templateUrl)throw new Error("Directive '"+this.name+"' is not a component, it is missing template.");var url_1=isFunction(this.directive.templateUrl)?this.directive.templateUrl():this.directive.templateUrl,html=templateCache.get(url_1);if(void 0===html)return new Promise(function(resolve,err){httpBackend("GET",url_1,null,function(status,response){200==status?resolve(_this.linkFn=compileHtml(templateCache.put(url_1,response))):err("GET "+url_1+" returned "+status+": "+response)})});this.linkFn=compileHtml(html)}return null},UpgradeNg1ComponentAdapterBuilder.resolve=function(exportedComponents,injector){var promises=[],compile=injector.get(NG1_COMPILE),templateCache=injector.get(NG1_TEMPLATE_CACHE),httpBackend=injector.get(NG1_HTTP_BACKEND),$controller=injector.get(NG1_CONTROLLER);for(var name_2 in exportedComponents)if(exportedComponents.hasOwnProperty(name_2)){var exportedComponent=exportedComponents[name_2];exportedComponent.directive=exportedComponent.extractDirective(injector),exportedComponent.$controller=$controller,exportedComponent.extractBindings();var promise=exportedComponent.compileTemplate(compile,templateCache,httpBackend);promise&&promises.push(promise)}return Promise.all(promises)},UpgradeNg1ComponentAdapterBuilder}(),UpgradeNg1ComponentAdapter=function(){function UpgradeNg1ComponentAdapter(linkFn,scope,directive,elementRef,$controller,inputs,outputs,propOuts,checkProperties,propertyMap){this.linkFn=linkFn,this.directive=directive,this.$controller=$controller,this.inputs=inputs,this.outputs=outputs,this.propOuts=propOuts,this.checkProperties=checkProperties,this.propertyMap=propertyMap,this.controllerInstance=null,this.destinationObj=null,this.checkLastValues=[],this.$element=null,this.element=elementRef.nativeElement,this.componentScope=scope.$new(!!directive.scope),this.$element=element(this.element);var controllerType=directive.controller;directive.bindToController&&controllerType?(this.controllerInstance=this.buildController(controllerType),this.destinationObj=this.controllerInstance):this.destinationObj=this.componentScope;for(var i=0;i<inputs.length;i++)this[inputs[i]]=null;for(var j=0;j<outputs.length;j++){var emitter=this[outputs[j]]=new _angular_core.EventEmitter;this.setComponentProperty(outputs[j],function(emitter){return function(value){return emitter.emit(value)}}(emitter))}for(var k=0;k<propOuts.length;k++)this[propOuts[k]]=new _angular_core.EventEmitter,this.checkLastValues.push(INITIAL_VALUE$1)}return UpgradeNg1ComponentAdapter.prototype.ngOnInit=function(){var _this=this;!this.directive.bindToController&&this.directive.controller&&(this.controllerInstance=this.buildController(this.directive.controller)),this.controllerInstance&&isFunction(this.controllerInstance.$onInit)&&this.controllerInstance.$onInit();var link=this.directive.link;if("object"==typeof link&&(link=link.pre),link){var attrs=NOT_SUPPORTED,transcludeFn=NOT_SUPPORTED,linkController=this.resolveRequired(this.$element,this.directive.require);this.directive.link(this.componentScope,this.$element,attrs,linkController,transcludeFn)}for(var childNode,childNodes=[];childNode=this.element.firstChild;)this.element.removeChild(childNode),childNodes.push(childNode);this.linkFn(this.componentScope,function(clonedElement,scope){for(var i=0,ii=clonedElement.length;i<ii;i++)_this.element.appendChild(clonedElement[i])},{parentBoundTranscludeFn:function(scope,cloneAttach){cloneAttach(childNodes)}}),this.controllerInstance&&isFunction(this.controllerInstance.$postLink)&&this.controllerInstance.$postLink()},UpgradeNg1ComponentAdapter.prototype.ngOnChanges=function(changes){var _this=this,ng1Changes={};Object.keys(changes).forEach(function(name){var change=changes[name];_this.setComponentProperty(name,change.currentValue),ng1Changes[_this.propertyMap[name]]=change}),isFunction(this.destinationObj.$onChanges)&&this.destinationObj.$onChanges(ng1Changes)},UpgradeNg1ComponentAdapter.prototype.ngDoCheck=function(){for(var destinationObj=this.destinationObj,lastValues=this.checkLastValues,checkProperties=this.checkProperties,i=0;i<checkProperties.length;i++){var value=destinationObj[checkProperties[i]],last=lastValues[i];if(value!==last)if("number"==typeof value&&isNaN(value)&&"number"==typeof last&&isNaN(last));else{var eventEmitter=this[this.propOuts[i]];eventEmitter.emit(lastValues[i]=value)}}this.controllerInstance&&isFunction(this.controllerInstance.$doCheck)&&this.controllerInstance.$doCheck()},UpgradeNg1ComponentAdapter.prototype.ngOnDestroy=function(){this.controllerInstance&&isFunction(this.controllerInstance.$onDestroy)&&this.controllerInstance.$onDestroy()},UpgradeNg1ComponentAdapter.prototype.setComponentProperty=function(name,value){this.destinationObj[this.propertyMap[name]]=value},UpgradeNg1ComponentAdapter.prototype.buildController=function(controllerType){var locals={$scope:this.componentScope,$element:this.$element},controller=this.$controller(controllerType,locals,null,this.directive.controllerAs);return this.$element.data(controllerKey(this.directive.name),controller),controller},UpgradeNg1ComponentAdapter.prototype.resolveRequired=function($element,require){if(require){if("string"==typeof require){var name_3=require,isOptional=!1,startParent=!1,searchParents=!1;"?"==name_3.charAt(0)&&(isOptional=!0,name_3=name_3.substr(1)),"^"==name_3.charAt(0)&&(searchParents=!0,name_3=name_3.substr(1)),"^"==name_3.charAt(0)&&(startParent=!0,name_3=name_3.substr(1));var key=controllerKey(name_3);startParent&&($element=$element.parent());var dep=searchParents?$element.inheritedData(key):$element.data(key);if(!dep&&!isOptional)throw new Error("Can not locate '"+require+"' in '"+this.directive.name+"'.");return dep}if(require instanceof Array){for(var deps=[],i=0;i<require.length;i++)deps.push(this.resolveRequired($element,require[i]));return deps}throw new Error("Directive '"+this.directive.name+"' require syntax unrecognized: "+this.directive.require)}},UpgradeNg1ComponentAdapter}(),upgradeCount=0,UpgradeAdapter=function(){function UpgradeAdapter(ng2AppModule,compilerOptions){if(this.ng2AppModule=ng2AppModule,this.compilerOptions=compilerOptions,this.idPrefix="NG2_UPGRADE_"+upgradeCount++ +"_",this.upgradedComponents=[],this.ng1ComponentsToBeUpgraded={},this.providers=[],this.moduleRef=null,!ng2AppModule)throw new Error("UpgradeAdapter cannot be instantiated without an NgModule of the Angular 2 app.")}return UpgradeAdapter.prototype.downgradeNg2Component=function(type){this.upgradedComponents.push(type);var info=getComponentInfo(type);return ng1ComponentDirective(info,""+this.idPrefix+info.selector+"_c")},UpgradeAdapter.prototype.upgradeNg1Component=function(name){return this.ng1ComponentsToBeUpgraded.hasOwnProperty(name)?this.ng1ComponentsToBeUpgraded[name].type:(this.ng1ComponentsToBeUpgraded[name]=new UpgradeNg1ComponentAdapterBuilder(name)).type},UpgradeAdapter.prototype.registerForNg1Tests=function(modules){var _this=this,windowNgMock=window.angular.mock;if(!windowNgMock||!windowNgMock.module)throw new Error("Failed to find 'angular.mock.module'.");this.declareNg1Module(modules),windowNgMock.module(this.ng1Module.name);var upgrade=new UpgradeAdapterRef;return this.ng2BootstrapDeferred.promise.then(function(ng1Injector){upgrade._bootstrapDone(_this.moduleRef,ng1Injector)},onError),upgrade},UpgradeAdapter.prototype.bootstrap=function(element$$,modules,config){var _this=this;this.declareNg1Module(modules);var upgrade=new UpgradeAdapterRef,windowAngular=window.angular;windowAngular.resumeBootstrap=void 0,this.ngZone.run(function(){bootstrap(element$$,[_this.ng1Module.name],config)});var ng1BootstrapPromise=new Promise(function(resolve){if(windowAngular.resumeBootstrap){var originalResumeBootstrap_1=windowAngular.resumeBootstrap;windowAngular.resumeBootstrap=function(){windowAngular.resumeBootstrap=originalResumeBootstrap_1,windowAngular.resumeBootstrap.apply(this,arguments),resolve()}}else resolve()});return Promise.all([this.ng2BootstrapDeferred.promise,ng1BootstrapPromise]).then(function(_a){var ng1Injector=_a[0];element(element$$).data(controllerKey(NG2_INJECTOR),_this.moduleRef.injector),_this.moduleRef.injector.get(_angular_core.NgZone).run(function(){upgrade._bootstrapDone(_this.moduleRef,ng1Injector)})},onError),upgrade},UpgradeAdapter.prototype.upgradeNg1Provider=function(name,options){var token=options&&options.asToken||name;this.providers.push({provide:token,useFactory:function(ng1Injector){return ng1Injector.get(name)},deps:[NG1_INJECTOR]})},UpgradeAdapter.prototype.downgradeNg2Provider=function(token){var factory=function(injector){return injector.get(token)};return factory.$inject=[NG2_INJECTOR],factory},UpgradeAdapter.prototype.declareNg1Module=function(modules){var _this=this;void 0===modules&&(modules=[]);var original$applyFn,rootScopePrototype,rootScope,delayApplyExps=[],componentFactoryRefMap={},upgradeAdapter=this,ng1Module=this.ng1Module=module$1(this.idPrefix,modules),platformRef=_angular_platformBrowserDynamic.platformBrowserDynamic();return this.ngZone=new _angular_core.NgZone({enableLongStackTrace:Zone.hasOwnProperty("longStackTraceZoneSpec")}),this.ng2BootstrapDeferred=new Deferred,ng1Module.factory(NG2_INJECTOR,function(){return _this.moduleRef.injector.get(_angular_core.Injector)}).constant(NG2_ZONE,this.ngZone).constant(NG2_COMPONENT_FACTORY_REF_MAP,componentFactoryRefMap).factory(NG2_COMPILER,function(){return _this.moduleRef.injector.get(_angular_core.Compiler)}).config(["$provide","$injector",function(provide,ng1Injector){provide.decorator(NG1_ROOT_SCOPE,["$delegate",function(rootScopeDelegate){if(rootScopePrototype=rootScopeDelegate.constructor.prototype,!rootScopePrototype.hasOwnProperty("$apply"))throw new Error("Failed to find '$apply' on '$rootScope'!");return original$applyFn=rootScopePrototype.$apply,rootScopePrototype.$apply=function(exp){return delayApplyExps.push(exp)},rootScope=rootScopeDelegate}]),ng1Injector.has(NG1_TESTABILITY)&&provide.decorator(NG1_TESTABILITY,["$delegate",function(testabilityDelegate){var originalWhenStable=testabilityDelegate.whenStable,newWhenStable=function(callback){originalWhenStable.call(this,function(){var ng2Testability=upgradeAdapter.moduleRef.injector.get(_angular_core.Testability);ng2Testability.isStable()?callback.apply(this,arguments):ng2Testability.whenStable(newWhenStable.bind(this,callback))})};return testabilityDelegate.whenStable=newWhenStable,testabilityDelegate}])}]),ng1Module.run(["$injector","$rootScope",function(ng1Injector,rootScope){UpgradeNg1ComponentAdapterBuilder.resolve(_this.ng1ComponentsToBeUpgraded,ng1Injector).then(function(){var DynamicNgUpgradeModule=_angular_core.NgModule({providers:[{provide:NG1_INJECTOR,useFactory:function(){return ng1Injector}},{provide:NG1_COMPILE,useFactory:function(){return ng1Injector.get(NG1_COMPILE)}},_this.providers],imports:[_this.ng2AppModule]}).Class({constructor:function(){},ngDoBootstrap:function(){}});platformRef._bootstrapModuleWithZone(DynamicNgUpgradeModule,_this.compilerOptions,_this.ngZone,function(componentFactories){componentFactories.forEach(function(componentFactory){var type=componentFactory.componentType;_this.upgradedComponents.indexOf(type)!==-1&&(componentFactoryRefMap[getComponentInfo(type).selector]=componentFactory)})}).then(function(ref){_this.moduleRef=ref,_this.ngZone.run(function(){if(rootScopePrototype){for(rootScopePrototype.$apply=original$applyFn;delayApplyExps.length;)rootScope.$apply(delayApplyExps.shift());rootScopePrototype=null}})}).then(function(){return _this.ng2BootstrapDeferred.resolve(ng1Injector)},onError).then(function(){var subscription=_this.ngZone.onMicrotaskEmpty.subscribe({next:function(){return rootScope.$digest()}});rootScope.$on("$destroy",function(){subscription.unsubscribe()})})}).catch(function(e){return _this.ng2BootstrapDeferred.reject(e)})}]),ng1Module},UpgradeAdapter}(),ParentInjectorPromise=function(){function ParentInjectorPromise(element){this.element=element,this.callbacks=[],element.data(controllerKey(NG2_INJECTOR),this)}return ParentInjectorPromise.prototype.then=function(callback){this.injector?callback(this.injector):this.callbacks.push(callback)},ParentInjectorPromise.prototype.resolve=function(injector){this.injector=injector,this.element.data(controllerKey(NG2_INJECTOR),injector),this.element=null,this.callbacks.forEach(function(callback){return callback(injector)}),this.callbacks.length=0},ParentInjectorPromise}(),UpgradeAdapterRef=function(){function UpgradeAdapterRef(){this._readyFn=null,this.ng1RootScope=null,this.ng1Injector=null,this.ng2ModuleRef=null,this.ng2Injector=null}return UpgradeAdapterRef.prototype._bootstrapDone=function(ngModuleRef,ng1Injector){this.ng2ModuleRef=ngModuleRef,this.ng2Injector=ngModuleRef.injector,this.ng1Injector=ng1Injector,this.ng1RootScope=ng1Injector.get(NG1_ROOT_SCOPE),this._readyFn&&this._readyFn(this)},UpgradeAdapterRef.prototype.ready=function(fn){this._readyFn=fn},UpgradeAdapterRef.prototype.dispose=function(){this.ng1Injector.get(NG1_ROOT_SCOPE).$destroy(),this.ng2ModuleRef.destroy()},UpgradeAdapterRef}(),VERSION=new _angular_core.Version("4.0.0-beta.4");exports.UpgradeAdapter=UpgradeAdapter,exports.UpgradeAdapterRef=UpgradeAdapterRef,exports.VERSION=VERSION});
{
"name": "@angular/upgrade",
"version": "4.0.0-beta.3",
"version": "4.0.0-beta.4",
"description": "Angular - the library for easing update from v1 to v2",

@@ -11,6 +11,6 @@ "main": "bundles/upgrade.umd.js",

"peerDependencies": {
"@angular/core": "4.0.0-beta.3",
"@angular/compiler": "4.0.0-beta.3",
"@angular/platform-browser": "4.0.0-beta.3",
"@angular/platform-browser-dynamic": "4.0.0-beta.3"
"@angular/core": "4.0.0-beta.4",
"@angular/compiler": "4.0.0-beta.4",
"@angular/platform-browser": "4.0.0-beta.4",
"@angular/platform-browser-dynamic": "4.0.0-beta.4"
},

@@ -17,0 +17,0 @@ "repository": {

@@ -9,6 +9,6 @@ /**

/**
* A `PropertyBinding` represents a mapping between a property name
* and an attribute name. It is parsed from a string of the form
* `"prop: attr"`; or simply `"propAndAttr" where the property
* and attribute have the same identifier.
* A `PropertyBinding` represents a mapping between a property name
* and an attribute name. It is parsed from a string of the form
* `"prop: attr"`; or simply `"propAndAttr" where the property
* and attribute have the same identifier.
*/

@@ -15,0 +15,0 @@ export var PropertyBinding = (function () {

@@ -13,43 +13,47 @@ /**

/**
* *
* *Part of the [upgrade/static](/docs/ts/latest/api/#!?query=upgrade%2Fstatic)
* library for hybrid upgrade apps that support AoT compilation*
* *
* Allows an Angular 2+ component to be used from Angular 1.
* *
* *
* Let's assume that you have an Angular 2+ component called `ng2Heroes` that needs
* to be made available in Angular 1 templates.
* *
* {@example upgrade/static/ts/module.ts region="ng2-heroes"}
* *
* We must create an Angular 1 [directive](https://docs.angularjs.org/guide/directive)
* that will make this Angular 2+ component available inside Angular 1 templates.
* The `downgradeComponent()` function returns a factory function that we
* can use to define the Angular 1 directive that wraps the "downgraded" component.
* *
* {@example upgrade/static/ts/module.ts region="ng2-heroes-wrapper"}
* *
* In this example you can see that we must provide information about the component being
* "downgraded". This is because once the AoT compiler has run, all metadata about the
* component has been removed from the code, and so cannot be inferred.
* *
* We must do the following:
* * specify the Angular 2+ component class that is to be downgraded
* * specify all inputs and outputs that the Angular 1 component expects
* *
* *
* A helper function that returns a factory function to be used for registering an
* Angular 1 wrapper directive for "downgrading" an Angular 2+ component.
* *
* The parameter contains information about the Component that is being downgraded:
* *
* * `component: Type<any>`: The type of the Component that will be downgraded
* * `inputs: string[]`: A collection of strings that specify what inputs the component accepts.
* * `outputs: string[]`: A collection of strings that specify what outputs the component emits.
* *
* The `inputs` and `outputs` are strings that map the names of properties to camelCased
* attribute names. They are of the form `"prop: attr"`; or simply `"propAndAttr" where the
* property and attribute have the same identifier.
* *
* \@whatItDoes
*
* *Part of the [upgrade/static](/docs/ts/latest/api/#!?query=upgrade%2Fstatic)
* library for hybrid upgrade apps that support AoT compilation*
*
* Allows an Angular 2+ component to be used from Angular 1.
*
* \@howToUse
*
* Let's assume that you have an Angular 2+ component called `ng2Heroes` that needs
* to be made available in Angular 1 templates.
*
* {\@example upgrade/static/ts/module.ts region="ng2-heroes"}
*
* We must create an Angular 1 [directive](https://docs.angularjs.org/guide/directive)
* that will make this Angular 2+ component available inside Angular 1 templates.
* The `downgradeComponent()` function returns a factory function that we
* can use to define the Angular 1 directive that wraps the "downgraded" component.
*
* {\@example upgrade/static/ts/module.ts region="ng2-heroes-wrapper"}
*
* In this example you can see that we must provide information about the component being
* "downgraded". This is because once the AoT compiler has run, all metadata about the
* component has been removed from the code, and so cannot be inferred.
*
* We must do the following:
* * specify the Angular 2+ component class that is to be downgraded
* * specify all inputs and outputs that the Angular 1 component expects
*
* \@description
*
* A helper function that returns a factory function to be used for registering an
* Angular 1 wrapper directive for "downgrading" an Angular 2+ component.
*
* The parameter contains information about the Component that is being downgraded:
*
* * `component: Type<any>`: The type of the Component that will be downgraded
* * `inputs: string[]`: A collection of strings that specify what inputs the component accepts.
* * `outputs: string[]`: A collection of strings that specify what outputs the component emits.
*
* The `inputs` and `outputs` are strings that map the names of properties to camelCased
* attribute names. They are of the form `"prop: attr"`; or simply `"propAndAttr" where the
* property and attribute have the same identifier.
*
* \@experimental
* @param {?} info

@@ -56,0 +60,0 @@ * @return {?}

@@ -10,38 +10,42 @@ /**

/**
* *
* *Part of the [upgrade/static](/docs/ts/latest/api/#!?query=upgrade%2Fstatic)
* library for hybrid upgrade apps that support AoT compilation*
* *
* Allow an Angular 2+ service to be accessible from Angular 1.
* *
* *
* First ensure that the service to be downgraded is provided in an {@link NgModule}
* that will be part of the upgrade application. For example, let's assume we have
* defined `HeroesService`
* *
* {@example upgrade/static/ts/module.ts region="ng2-heroes-service"}
* *
* and that we have included this in our upgrade app {@link NgModule}
* *
* {@example upgrade/static/ts/module.ts region="ng2-module"}
* *
* Now we can register the `downgradeInjectable` factory function for the service
* on an Angular 1 module.
* *
* {@example upgrade/static/ts/module.ts region="downgrade-ng2-heroes-service"}
* *
* Inside an Angular 1 component's controller we can get hold of the
* downgraded service via the name we gave when downgrading.
* *
* {@example upgrade/static/ts/module.ts region="example-app"}
* *
* *
* Takes a `token` that identifies a service provided from Angular 2+.
* *
* Returns a [factory function](https://docs.angularjs.org/guide/di) that can be
* used to register the service on an Angular 1 module.
* *
* The factory function provides access to the Angular 2+ service that
* is identified by the `token` parameter.
* *
* \@whatItDoes
*
* *Part of the [upgrade/static](/docs/ts/latest/api/#!?query=upgrade%2Fstatic)
* library for hybrid upgrade apps that support AoT compilation*
*
* Allow an Angular 2+ service to be accessible from Angular 1.
*
* \@howToUse
*
* First ensure that the service to be downgraded is provided in an {\@link NgModule}
* that will be part of the upgrade application. For example, let's assume we have
* defined `HeroesService`
*
* {\@example upgrade/static/ts/module.ts region="ng2-heroes-service"}
*
* and that we have included this in our upgrade app {\@link NgModule}
*
* {\@example upgrade/static/ts/module.ts region="ng2-module"}
*
* Now we can register the `downgradeInjectable` factory function for the service
* on an Angular 1 module.
*
* {\@example upgrade/static/ts/module.ts region="downgrade-ng2-heroes-service"}
*
* Inside an Angular 1 component's controller we can get hold of the
* downgraded service via the name we gave when downgrading.
*
* {\@example upgrade/static/ts/module.ts region="example-app"}
*
* \@description
*
* Takes a `token` that identifies a service provided from Angular 2+.
*
* Returns a [factory function](https://docs.angularjs.org/guide/di) that can be
* used to register the service on an Angular 1 module.
*
* The factory function provides access to the Angular 2+ service that
* is identified by the `token` parameter.
*
* \@experimental
* @param {?} token

@@ -48,0 +52,0 @@ * @return {?}

@@ -38,53 +38,57 @@ /**

/**
* *
* *Part of the [upgrade/static](/docs/ts/latest/api/#!?query=upgrade%2Fstatic)
* library for hybrid upgrade apps that support AoT compilation*
* *
* Allows an Angular 1 component to be used from Angular 2+.
* *
* *
* Let's assume that you have an Angular 1 component called `ng1Hero` that needs
* to be made available in Angular 2+ templates.
* *
* {@example upgrade/static/ts/module.ts region="ng1-hero"}
* *
* We must create a {@link Directive} that will make this Angular 1 component
* available inside Angular 2+ templates.
* *
* {@example upgrade/static/ts/module.ts region="ng1-hero-wrapper"}
* *
* In this example you can see that we must derive from the {@link UpgradeComponent}
* base class but also provide an {@link Directive `@Directive`} decorator. This is
* because the AoT compiler requires that this information is statically available at
* compile time.
* *
* Note that we must do the following:
* * specify the directive's selector (`ng1-hero`)
* * specify all inputs and outputs that the Angular 1 component expects
* * derive from `UpgradeComponent`
* * call the base class from the constructor, passing
* * the Angular 1 name of the component (`ng1Hero`)
* * the {@link ElementRef} and {@link Injector} for the component wrapper
* *
* *
* A helper class that should be used as a base class for creating Angular directives
* that wrap Angular 1 components that need to be "upgraded".
* *
* \@whatItDoes
*
* *Part of the [upgrade/static](/docs/ts/latest/api/#!?query=upgrade%2Fstatic)
* library for hybrid upgrade apps that support AoT compilation*
*
* Allows an Angular 1 component to be used from Angular 2+.
*
* \@howToUse
*
* Let's assume that you have an Angular 1 component called `ng1Hero` that needs
* to be made available in Angular 2+ templates.
*
* {\@example upgrade/static/ts/module.ts region="ng1-hero"}
*
* We must create a {\@link Directive} that will make this Angular 1 component
* available inside Angular 2+ templates.
*
* {\@example upgrade/static/ts/module.ts region="ng1-hero-wrapper"}
*
* In this example you can see that we must derive from the {\@link UpgradeComponent}
* base class but also provide an {\@link Directive `\@Directive`} decorator. This is
* because the AoT compiler requires that this information is statically available at
* compile time.
*
* Note that we must do the following:
* * specify the directive's selector (`ng1-hero`)
* * specify all inputs and outputs that the Angular 1 component expects
* * derive from `UpgradeComponent`
* * call the base class from the constructor, passing
* * the Angular 1 name of the component (`ng1Hero`)
* * the {\@link ElementRef} and {\@link Injector} for the component wrapper
*
* \@description
*
* A helper class that should be used as a base class for creating Angular directives
* that wrap Angular 1 components that need to be "upgraded".
*
* \@experimental
*/
export var UpgradeComponent = (function () {
/**
* Create a new `UpgradeComponent` instance. You should not normally need to do this.
* Instead you should derive a new class from this one and call the super constructor
* from the base class.
* *
* {@example upgrade/static/ts/module.ts region="ng1-hero-wrapper" }
* *
* * The `name` parameter should be the name of the Angular 1 directive.
* * The `elementRef` and `injector` parameters should be acquired from Angular by dependency
* injection into the base class constructor.
* *
* Note that we must manually implement lifecycle hooks that call through to the super class.
* This is because, at the moment, the AoT compiler is not able to tell that the
* `UpgradeComponent`
* already implements them and so does not wire up calls to them at runtime.
* Create a new `UpgradeComponent` instance. You should not normally need to do this.
* Instead you should derive a new class from this one and call the super constructor
* from the base class.
*
* {\@example upgrade/static/ts/module.ts region="ng1-hero-wrapper" }
*
* * The `name` parameter should be the name of the Angular 1 directive.
* * The `elementRef` and `injector` parameters should be acquired from Angular by dependency
* injection into the base class constructor.
*
* Note that we must manually implement lifecycle hooks that call through to the super class.
* This is because, at the moment, the AoT compiler is not able to tell that the
* `UpgradeComponent`
* already implements them and so does not wire up calls to them at runtime.
* @param {?} name

@@ -91,0 +95,0 @@ * @param {?} elementRef

@@ -14,109 +14,113 @@ /**

/**
* *
* *Part of the [upgrade/static](/docs/ts/latest/api/#!?query=upgrade%2Fstatic)
* library for hybrid upgrade apps that support AoT compilation*
* *
* Allows Angular 1 and Angular 2+ components to be used together inside a hybrid upgrade
* application, which supports AoT compilation.
* *
* Specifically, the classes and functions in the `upgrade/static` module allow the following:
* 1. Creation of an Angular 2+ directive that wraps and exposes an Angular 1 component so
* that it can be used in an Angular 2 template. See {@link UpgradeComponent}.
* 2. Creation of an Angular 1 directive that wraps and exposes an Angular 2+ component so
* that it can be used in an Angular 1 template. See {@link downgradeComponent}.
* 3. Creation of an Angular 2+ root injector provider that wraps and exposes an Angular 1
* service so that it can be injected into an Angular 2+ context. See
* {@link UpgradeModule#upgrading-an-angular-1-service Upgrading an Angular 1 service} below.
* 4. Creation of an Angular 1 service that wraps and exposes an Angular 2+ injectable
* so that it can be injected into an Angular 1 context. See {@link downgradeInjectable}.
* 3. Bootstrapping of a hybrid Angular application which contains both of the frameworks
* coexisting in a single application. See the
* {@link UpgradeModule#example example} below.
* *
* ## Mental Model
* *
* When reasoning about how a hybrid application works it is useful to have a mental model which
* describes what is happening and explains what is happening at the lowest level.
* *
* 1. There are two independent frameworks running in a single application, each framework treats
* the other as a black box.
* 2. Each DOM element on the page is owned exactly by one framework. Whichever framework
* instantiated the element is the owner. Each framework only updates/interacts with its own
* DOM elements and ignores others.
* 3. Angular 1 directives always execute inside the Angular 1 framework codebase regardless of
* where they are instantiated.
* 4. Angular 2+ components always execute inside the Angular 2+ framework codebase regardless of
* where they are instantiated.
* 5. An Angular 1 component can be "upgraded"" to an Angular 2+ component. This is achieved by
* defining an Angular 2+ directive, which bootstraps the Angular 1 component at its location
* in the DOM. See {@link UpgradeComponent}.
* 6. An Angular 2+ component can be "downgraded"" to an Angular 1 component. This is achieved by
* defining an Angular 1 directive, which bootstraps the Angular 2+ component at its location
* in the DOM. See {@link downgradeComponent}.
* 7. Whenever an "upgraded"/"downgraded" component is instantiated the host element is owned by
* the framework doing the instantiation. The other framework then instantiates and owns the
* view for that component.
* a. This implies that the component bindings will always follow the semantics of the
* instantiation framework.
* b. The DOM attributes are parsed by the framework that owns the current template. So
* attributes
* in Angular 1 templates must use kebab-case, while Angular 1 templates must use camelCase.
* c. However the template binding syntax will always use the Angular 2+ style, e.g. square
* brackets (`[...]`) for property binding.
* 8. Angular 1 is always bootstrapped first and owns the root component.
* 9. The new application is running in an Angular 2+ zone, and therefore it no longer needs calls
* to
* `$apply()`.
* *
* *
* `import {UpgradeModule} from '@angular/upgrade/static';`
* *
* ## Example
* Import the {@link UpgradeModule} into your top level {@link NgModule Angular 2+ `NgModule`}.
* *
* {@example upgrade/static/ts/module.ts region='ng2-module'}
* *
* Then bootstrap the hybrid upgrade app's module, get hold of the {@link UpgradeModule} instance
* and use it to bootstrap the top level [Angular 1
* module](https://docs.angularjs.org/api/ng/type/angular.Module).
* *
* {@example upgrade/static/ts/module.ts region='bootstrap'}
* *
* *
* ## Upgrading an Angular 1 service
* *
* There is no specific API for upgrading an Angular 1 service. Instead you should just follow the
* following recipe:
* *
* Let's say you have an Angular 1 service:
* *
* {@example upgrade/static/ts/module.ts region="ng1-title-case-service"}
* *
* Then you should define an Angular 2+ provider to be included in your {@link NgModule} `providers`
* property.
* *
* {@example upgrade/static/ts/module.ts region="upgrade-ng1-service"}
* *
* Then you can use the "upgraded" Angular 1 service by injecting it into an Angular 2 component
* or service.
* *
* {@example upgrade/static/ts/module.ts region="use-ng1-upgraded-service"}
* *
* *
* This class is an `NgModule`, which you import to provide Angular 1 core services,
* and has an instance method used to bootstrap the hybrid upgrade application.
* *
* ## Core Angular 1 services
* Importing this {@link NgModule} will add providers for the core
* [Angular 1 services](https://docs.angularjs.org/api/ng/service) to the root injector.
* *
* ## Bootstrap
* The runtime instance of this class contains a {@link UpgradeModule#bootstrap `bootstrap()`}
* method, which you use to bootstrap the top level Angular 1 module onto an element in the
* DOM for the hybrid upgrade app.
* *
* It also contains properties to access the {@link UpgradeModule#injector root injector}, the
* bootstrap {@link NgZone} and the
* [Angular 1 $injector](https://docs.angularjs.org/api/auto/service/$injector).
* *
* \@whatItDoes
*
* *Part of the [upgrade/static](/docs/ts/latest/api/#!?query=upgrade%2Fstatic)
* library for hybrid upgrade apps that support AoT compilation*
*
* Allows Angular 1 and Angular 2+ components to be used together inside a hybrid upgrade
* application, which supports AoT compilation.
*
* Specifically, the classes and functions in the `upgrade/static` module allow the following:
* 1. Creation of an Angular 2+ directive that wraps and exposes an Angular 1 component so
* that it can be used in an Angular 2 template. See {\@link UpgradeComponent}.
* 2. Creation of an Angular 1 directive that wraps and exposes an Angular 2+ component so
* that it can be used in an Angular 1 template. See {\@link downgradeComponent}.
* 3. Creation of an Angular 2+ root injector provider that wraps and exposes an Angular 1
* service so that it can be injected into an Angular 2+ context. See
* {\@link UpgradeModule#upgrading-an-angular-1-service Upgrading an Angular 1 service} below.
* 4. Creation of an Angular 1 service that wraps and exposes an Angular 2+ injectable
* so that it can be injected into an Angular 1 context. See {\@link downgradeInjectable}.
* 3. Bootstrapping of a hybrid Angular application which contains both of the frameworks
* coexisting in a single application. See the
* {\@link UpgradeModule#example example} below.
*
* ## Mental Model
*
* When reasoning about how a hybrid application works it is useful to have a mental model which
* describes what is happening and explains what is happening at the lowest level.
*
* 1. There are two independent frameworks running in a single application, each framework treats
* the other as a black box.
* 2. Each DOM element on the page is owned exactly by one framework. Whichever framework
* instantiated the element is the owner. Each framework only updates/interacts with its own
* DOM elements and ignores others.
* 3. Angular 1 directives always execute inside the Angular 1 framework codebase regardless of
* where they are instantiated.
* 4. Angular 2+ components always execute inside the Angular 2+ framework codebase regardless of
* where they are instantiated.
* 5. An Angular 1 component can be "upgraded"" to an Angular 2+ component. This is achieved by
* defining an Angular 2+ directive, which bootstraps the Angular 1 component at its location
* in the DOM. See {\@link UpgradeComponent}.
* 6. An Angular 2+ component can be "downgraded"" to an Angular 1 component. This is achieved by
* defining an Angular 1 directive, which bootstraps the Angular 2+ component at its location
* in the DOM. See {\@link downgradeComponent}.
* 7. Whenever an "upgraded"/"downgraded" component is instantiated the host element is owned by
* the framework doing the instantiation. The other framework then instantiates and owns the
* view for that component.
* a. This implies that the component bindings will always follow the semantics of the
* instantiation framework.
* b. The DOM attributes are parsed by the framework that owns the current template. So
* attributes
* in Angular 1 templates must use kebab-case, while Angular 1 templates must use camelCase.
* c. However the template binding syntax will always use the Angular 2+ style, e.g. square
* brackets (`[...]`) for property binding.
* 8. Angular 1 is always bootstrapped first and owns the root component.
* 9. The new application is running in an Angular 2+ zone, and therefore it no longer needs calls
* to
* `$apply()`.
*
* \@howToUse
*
* `import {UpgradeModule} from '\@angular/upgrade/static';`
*
* ## Example
* Import the {\@link UpgradeModule} into your top level {\@link NgModule Angular 2+ `NgModule`}.
*
* {\@example upgrade/static/ts/module.ts region='ng2-module'}
*
* Then bootstrap the hybrid upgrade app's module, get hold of the {\@link UpgradeModule} instance
* and use it to bootstrap the top level [Angular 1
* module](https://docs.angularjs.org/api/ng/type/angular.Module).
*
* {\@example upgrade/static/ts/module.ts region='bootstrap'}
*
*
* ## Upgrading an Angular 1 service
*
* There is no specific API for upgrading an Angular 1 service. Instead you should just follow the
* following recipe:
*
* Let's say you have an Angular 1 service:
*
* {\@example upgrade/static/ts/module.ts region="ng1-title-case-service"}
*
* Then you should define an Angular 2+ provider to be included in your {\@link NgModule} `providers`
* property.
*
* {\@example upgrade/static/ts/module.ts region="upgrade-ng1-service"}
*
* Then you can use the "upgraded" Angular 1 service by injecting it into an Angular 2 component
* or service.
*
* {\@example upgrade/static/ts/module.ts region="use-ng1-upgraded-service"}
*
* \@description
*
* This class is an `NgModule`, which you import to provide Angular 1 core services,
* and has an instance method used to bootstrap the hybrid upgrade application.
*
* ## Core Angular 1 services
* Importing this {\@link NgModule} will add providers for the core
* [Angular 1 services](https://docs.angularjs.org/api/ng/service) to the root injector.
*
* ## Bootstrap
* The runtime instance of this class contains a {\@link UpgradeModule#bootstrap `bootstrap()`}
* method, which you use to bootstrap the top level Angular 1 module onto an element in the
* DOM for the hybrid upgrade app.
*
* It also contains properties to access the {\@link UpgradeModule#injector root injector}, the
* bootstrap {\@link NgZone} and the
* [Angular 1 $injector](https://docs.angularjs.org/api/auto/service/$injector).
*
* \@experimental
*/

@@ -133,3 +137,3 @@ export var UpgradeModule = (function () {

/**
* Bootstrap an Angular 1 application from this NgModule
* Bootstrap an Angular 1 application from this NgModule
* @param {?} element the element on which to bootstrap the Angular 1 application

@@ -230,3 +234,3 @@ * @param {?=} modules

/**
* The root {@link Injector} for the upgrade application.
* The root {\@link Injector} for the upgrade application.
* @type {?}

@@ -233,0 +237,0 @@ */

@@ -19,76 +19,79 @@ /**

/**
* Use `UpgradeAdapter` to allow Angular 1 and Angular 2+ to coexist in a single application.
* *
* The `UpgradeAdapter` allows:
* 1. creation of Angular 2+ component from Angular 1 component directive
* (See [UpgradeAdapter#upgradeNg1Component()])
* 2. creation of Angular 1 directive from Angular 2+ component.
* (See [UpgradeAdapter#downgradeNg2Component()])
* 3. Bootstrapping of a hybrid Angular application which contains both of the frameworks
* coexisting in a single application.
* *
* ## Mental Model
* *
* When reasoning about how a hybrid application works it is useful to have a mental model which
* describes what is happening and explains what is happening at the lowest level.
* *
* 1. There are two independent frameworks running in a single application, each framework treats
* the other as a black box.
* 2. Each DOM element on the page is owned exactly by one framework. Whichever framework
* instantiated the element is the owner. Each framework only updates/interacts with its own
* DOM elements and ignores others.
* 3. Angular 1 directives always execute inside Angular 1 framework codebase regardless of
* where they are instantiated.
* 4. Angular 2+ components always execute inside Angular 2+ framework codebase regardless of
* where they are instantiated.
* 5. An Angular 1 component can be upgraded to an Angular 2+ component. This creates an
* Angular 2+ directive, which bootstraps the Angular 1 component directive in that location.
* 6. An Angular 2+ component can be downgraded to an Angular 1 component directive. This creates
* an Angular 1 directive, which bootstraps the Angular 2+ component in that location.
* 7. Whenever an adapter component is instantiated the host element is owned by the framework
* doing the instantiation. The other framework then instantiates and owns the view for that
* component. This implies that component bindings will always follow the semantics of the
* instantiation framework. The syntax is always that of Angular 2+ syntax.
* 8. Angular 1 is always bootstrapped first and owns the bottom most view.
* 9. The new application is running in Angular 2+ zone, and therefore it no longer needs calls to
* `$apply()`.
* *
* ### Example
* *
* ```
* const adapter = new UpgradeAdapter(forwardRef(() => MyNg2Module), myCompilerOptions);
* const module = angular.module('myExample', []);
* module.directive('ng2Comp', adapter.downgradeNg2Component(Ng2Component));
* *
* module.directive('ng1Hello', function() {
* return {
* scope: { title: '=' },
* template: 'ng1[Hello {{title}}!](<span ng-transclude></span>)'
* };
* });
* *
* *
* selector: 'ng2-comp',
* inputs: ['name'],
* template: 'ng2[<ng1-hello [title]="name">transclude</ng1-hello>](<ng-content></ng-content>)',
* directives:
* })
* class Ng2Component {
* }
* *
* declarations: [Ng2Component, adapter.upgradeNg1Component('ng1Hello')],
* imports: [BrowserModule]
* })
* class MyNg2Module {}
* *
* *
* document.body.innerHTML = '<ng2-comp name="World">project</ng2-comp>';
* *
* adapter.bootstrap(document.body, ['myExample']).ready(function() {
* expect(document.body.textContent).toEqual(
* "ng2[ng1[Hello World!](transclude)](project)");
* });
* *
* ```
* *
* Use `UpgradeAdapter` to allow Angular 1 and Angular 2+ to coexist in a single application.
*
* The `UpgradeAdapter` allows:
* 1. creation of Angular 2+ component from Angular 1 component directive
* (See [UpgradeAdapter#upgradeNg1Component()])
* 2. creation of Angular 1 directive from Angular 2+ component.
* (See [UpgradeAdapter#downgradeNg2Component()])
* 3. Bootstrapping of a hybrid Angular application which contains both of the frameworks
* coexisting in a single application.
*
* ## Mental Model
*
* When reasoning about how a hybrid application works it is useful to have a mental model which
* describes what is happening and explains what is happening at the lowest level.
*
* 1. There are two independent frameworks running in a single application, each framework treats
* the other as a black box.
* 2. Each DOM element on the page is owned exactly by one framework. Whichever framework
* instantiated the element is the owner. Each framework only updates/interacts with its own
* DOM elements and ignores others.
* 3. Angular 1 directives always execute inside Angular 1 framework codebase regardless of
* where they are instantiated.
* 4. Angular 2+ components always execute inside Angular 2+ framework codebase regardless of
* where they are instantiated.
* 5. An Angular 1 component can be upgraded to an Angular 2+ component. This creates an
* Angular 2+ directive, which bootstraps the Angular 1 component directive in that location.
* 6. An Angular 2+ component can be downgraded to an Angular 1 component directive. This creates
* an Angular 1 directive, which bootstraps the Angular 2+ component in that location.
* 7. Whenever an adapter component is instantiated the host element is owned by the framework
* doing the instantiation. The other framework then instantiates and owns the view for that
* component. This implies that component bindings will always follow the semantics of the
* instantiation framework. The syntax is always that of Angular 2+ syntax.
* 8. Angular 1 is always bootstrapped first and owns the bottom most view.
* 9. The new application is running in Angular 2+ zone, and therefore it no longer needs calls to
* `$apply()`.
*
* ### Example
*
* ```
* const adapter = new UpgradeAdapter(forwardRef(() => MyNg2Module), myCompilerOptions);
* const module = angular.module('myExample', []);
* module.directive('ng2Comp', adapter.downgradeNg2Component(Ng2Component));
*
* module.directive('ng1Hello', function() {
* return {
* scope: { title: '=' },
* template: 'ng1[Hello {{title}}!](<span ng-transclude></span>)'
* };
* });
*
*
* \@Component({
* selector: 'ng2-comp',
* inputs: ['name'],
* template: 'ng2[<ng1-hello [title]="name">transclude</ng1-hello>](<ng-content></ng-content>)',
* directives:
* })
* class Ng2Component {
* }
*
* \@NgModule({
* declarations: [Ng2Component, adapter.upgradeNg1Component('ng1Hello')],
* imports: [BrowserModule]
* })
* class MyNg2Module {}
*
*
* document.body.innerHTML = '<ng2-comp name="World">project</ng2-comp>';
*
* adapter.bootstrap(document.body, ['myExample']).ready(function() {
* expect(document.body.textContent).toEqual(
* "ng2[ng1[Hello World!](transclude)](project)");
* });
*
* ```
*
* \@stable
*/

@@ -113,53 +116,55 @@ export var UpgradeAdapter = (function () {

/**
* Allows Angular 2+ Component to be used from Angular 1.
* *
* Use `downgradeNg2Component` to create an Angular 1 Directive Definition Factory from
* Angular 2+ Component. The adapter will bootstrap Angular 2+ component from within the
* Angular 1 template.
* *
* ## Mental Model
* *
* 1. The component is instantiated by being listed in Angular 1 template. This means that the
* host element is controlled by Angular 1, but the component's view will be controlled by
* Angular 2+.
* 2. Even thought the component is instantiated in Angular 1, it will be using Angular 2+
* syntax. This has to be done, this way because we must follow Angular 2+ components do not
* declare how the attributes should be interpreted.
* *
* ## Supported Features
* *
* - Bindings:
* - Attribute: `<comp name="World">`
* - Interpolation: `<comp greeting="Hello {{name}}!">`
* - Expression: `<comp [name]="username">`
* - Event: `<comp (close)="doSomething()">`
* - Content projection: yes
* *
* ### Example
* *
* ```
* const adapter = new UpgradeAdapter(forwardRef(() => MyNg2Module));
* const module = angular.module('myExample', []);
* module.directive('greet', adapter.downgradeNg2Component(Greeter));
* *
* selector: 'greet',
* template: '{{salutation}} {{name}}! - <ng-content></ng-content>'
* })
* class Greeter {
* @Input() salutation: string;
* @Input() name: string;
* }
* *
* declarations: [Greeter],
* imports: [BrowserModule]
* })
* class MyNg2Module {}
* *
* document.body.innerHTML =
* 'ng1 template: <greet salutation="Hello" [name]="world">text</greet>';
* *
* adapter.bootstrap(document.body, ['myExample']).ready(function() {
* expect(document.body.textContent).toEqual("ng1 template: Hello world! - text");
* });
* ```
* Allows Angular 2+ Component to be used from Angular 1.
*
* Use `downgradeNg2Component` to create an Angular 1 Directive Definition Factory from
* Angular 2+ Component. The adapter will bootstrap Angular 2+ component from within the
* Angular 1 template.
*
* ## Mental Model
*
* 1. The component is instantiated by being listed in Angular 1 template. This means that the
* host element is controlled by Angular 1, but the component's view will be controlled by
* Angular 2+.
* 2. Even thought the component is instantiated in Angular 1, it will be using Angular 2+
* syntax. This has to be done, this way because we must follow Angular 2+ components do not
* declare how the attributes should be interpreted.
*
* ## Supported Features
*
* - Bindings:
* - Attribute: `<comp name="World">`
* - Interpolation: `<comp greeting="Hello {{name}}!">`
* - Expression: `<comp [name]="username">`
* - Event: `<comp (close)="doSomething()">`
* - Content projection: yes
*
* ### Example
*
* ```
* const adapter = new UpgradeAdapter(forwardRef(() => MyNg2Module));
* const module = angular.module('myExample', []);
* module.directive('greet', adapter.downgradeNg2Component(Greeter));
*
* \@Component({
* selector: 'greet',
* template: '{{salutation}} {{name}}! - <ng-content></ng-content>'
* })
* class Greeter {
* \@Input() salutation: string;
* \@Input() name: string;
* }
*
* \@NgModule({
* declarations: [Greeter],
* imports: [BrowserModule]
* })
* class MyNg2Module {}
*
* document.body.innerHTML =
* 'ng1 template: <greet salutation="Hello" [name]="world">text</greet>';
*
* adapter.bootstrap(document.body, ['myExample']).ready(function() {
* expect(document.body.textContent).toEqual("ng1 template: Hello world! - text");
* });
* ```
* @param {?} type

@@ -174,75 +179,77 @@ * @return {?}

/**
* Allows Angular 1 Component to be used from Angular 2+.
* *
* Use `upgradeNg1Component` to create an Angular 2+ component from Angular 1 Component
* directive. The adapter will bootstrap Angular 1 component from within the Angular 2+
* template.
* *
* ## Mental Model
* *
* 1. The component is instantiated by being listed in Angular 2+ template. This means that the
* host element is controlled by Angular 2+, but the component's view will be controlled by
* Angular 1.
* *
* ## Supported Features
* *
* - Bindings:
* - Attribute: `<comp name="World">`
* - Interpolation: `<comp greeting="Hello {{name}}!">`
* - Expression: `<comp [name]="username">`
* - Event: `<comp (close)="doSomething()">`
* - Transclusion: yes
* - Only some of the features of
* [Directive Definition Object](https://docs.angularjs.org/api/ng/service/$compile) are
* supported:
* - `compile`: not supported because the host element is owned by Angular 2+, which does
* not allow modifying DOM structure during compilation.
* - `controller`: supported. (NOTE: injection of `$attrs` and `$transclude` is not supported.)
* - `controllerAs`: supported.
* - `bindToController`: supported.
* - `link`: supported. (NOTE: only pre-link function is supported.)
* - `name`: supported.
* - `priority`: ignored.
* - `replace`: not supported.
* - `require`: supported.
* - `restrict`: must be set to 'E'.
* - `scope`: supported.
* - `template`: supported.
* - `templateUrl`: supported.
* - `terminal`: ignored.
* - `transclude`: supported.
* *
* *
* ### Example
* *
* ```
* const adapter = new UpgradeAdapter(forwardRef(() => MyNg2Module));
* const module = angular.module('myExample', []);
* *
* module.directive('greet', function() {
* return {
* scope: {salutation: '=', name: '=' },
* template: '{{salutation}} {{name}}! - <span ng-transclude></span>'
* };
* });
* *
* module.directive('ng2', adapter.downgradeNg2Component(Ng2Component));
* *
* selector: 'ng2',
* template: 'ng2 template: <greet salutation="Hello" [name]="world">text</greet>'
* })
* class Ng2Component {
* }
* *
* declarations: [Ng2Component, adapter.upgradeNg1Component('greet')],
* imports: [BrowserModule]
* })
* class MyNg2Module {}
* *
* document.body.innerHTML = '<ng2></ng2>';
* *
* adapter.bootstrap(document.body, ['myExample']).ready(function() {
* expect(document.body.textContent).toEqual("ng2 template: Hello world! - text");
* });
* ```
* Allows Angular 1 Component to be used from Angular 2+.
*
* Use `upgradeNg1Component` to create an Angular 2+ component from Angular 1 Component
* directive. The adapter will bootstrap Angular 1 component from within the Angular 2+
* template.
*
* ## Mental Model
*
* 1. The component is instantiated by being listed in Angular 2+ template. This means that the
* host element is controlled by Angular 2+, but the component's view will be controlled by
* Angular 1.
*
* ## Supported Features
*
* - Bindings:
* - Attribute: `<comp name="World">`
* - Interpolation: `<comp greeting="Hello {{name}}!">`
* - Expression: `<comp [name]="username">`
* - Event: `<comp (close)="doSomething()">`
* - Transclusion: yes
* - Only some of the features of
* [Directive Definition Object](https://docs.angularjs.org/api/ng/service/$compile) are
* supported:
* - `compile`: not supported because the host element is owned by Angular 2+, which does
* not allow modifying DOM structure during compilation.
* - `controller`: supported. (NOTE: injection of `$attrs` and `$transclude` is not supported.)
* - `controllerAs`: supported.
* - `bindToController`: supported.
* - `link`: supported. (NOTE: only pre-link function is supported.)
* - `name`: supported.
* - `priority`: ignored.
* - `replace`: not supported.
* - `require`: supported.
* - `restrict`: must be set to 'E'.
* - `scope`: supported.
* - `template`: supported.
* - `templateUrl`: supported.
* - `terminal`: ignored.
* - `transclude`: supported.
*
*
* ### Example
*
* ```
* const adapter = new UpgradeAdapter(forwardRef(() => MyNg2Module));
* const module = angular.module('myExample', []);
*
* module.directive('greet', function() {
* return {
* scope: {salutation: '=', name: '=' },
* template: '{{salutation}} {{name}}! - <span ng-transclude></span>'
* };
* });
*
* module.directive('ng2', adapter.downgradeNg2Component(Ng2Component));
*
* \@Component({
* selector: 'ng2',
* template: 'ng2 template: <greet salutation="Hello" [name]="world">text</greet>'
* })
* class Ng2Component {
* }
*
* \@NgModule({
* declarations: [Ng2Component, adapter.upgradeNg1Component('greet')],
* imports: [BrowserModule]
* })
* class MyNg2Module {}
*
* document.body.innerHTML = '<ng2></ng2>';
*
* adapter.bootstrap(document.body, ['myExample']).ready(function() {
* expect(document.body.textContent).toEqual("ng2 template: Hello world! - text");
* });
* ```
* @param {?} name

@@ -261,41 +268,41 @@ * @return {?}

/**
* Registers the adapter's Angular 1 upgrade module for unit testing in Angular 1.
* Use this instead of `angular.mock.module()` to load the upgrade module into
* the Angular 1 testing injector.
* *
* ### Example
* *
* ```
* const upgradeAdapter = new UpgradeAdapter(MyNg2Module);
* *
* // configure the adapter with upgrade/downgrade components and services
* upgradeAdapter.downgradeNg2Component(MyComponent);
* *
* let upgradeAdapterRef: UpgradeAdapterRef;
* let $compile, $rootScope;
* *
* // We must register the adapter before any calls to `inject()`
* beforeEach(() => {
* upgradeAdapterRef = upgradeAdapter.registerForNg1Tests(['heroApp']);
* });
* *
* beforeEach(inject((_$compile_, _$rootScope_) => {
* $compile = _$compile_;
* $rootScope = _$rootScope_;
* }));
* *
* it("says hello", (done) => {
* upgradeAdapterRef.ready(() => {
* const element = $compile("<my-component></my-component>")($rootScope);
* $rootScope.$apply();
* expect(element.html()).toContain("Hello World");
* done();
* })
* });
* *
* ```
* *
* Registers the adapter's Angular 1 upgrade module for unit testing in Angular 1.
* Use this instead of `angular.mock.module()` to load the upgrade module into
* the Angular 1 testing injector.
*
* ### Example
*
* ```
* const upgradeAdapter = new UpgradeAdapter(MyNg2Module);
*
* // configure the adapter with upgrade/downgrade components and services
* upgradeAdapter.downgradeNg2Component(MyComponent);
*
* let upgradeAdapterRef: UpgradeAdapterRef;
* let $compile, $rootScope;
*
* // We must register the adapter before any calls to `inject()`
* beforeEach(() => {
* upgradeAdapterRef = upgradeAdapter.registerForNg1Tests(['heroApp']);
* });
*
* beforeEach(inject((_$compile_, _$rootScope_) => {
* $compile = _$compile_;
* $rootScope = _$rootScope_;
* }));
*
* it("says hello", (done) => {
* upgradeAdapterRef.ready(() => {
* const element = $compile("<my-component></my-component>")($rootScope);
* $rootScope.$apply();
* expect(element.html()).toContain("Hello World");
* done();
* })
* });
*
* ```
*
* @param {?=} modules any Angular 1 modules that the upgrade module should depend upon
* @return {?} an {@link UpgradeAdapterRef}, which lets you register a `ready()` callback to
* run assertions once the Angular 2+ components are ready to test through Angular 1.
* @return {?} an {\@link UpgradeAdapterRef}, which lets you register a `ready()` callback to
* run assertions once the Angular 2+ components are ready to test through Angular 1.
*/

@@ -315,42 +322,44 @@ UpgradeAdapter.prototype.registerForNg1Tests = function (modules) {

/**
* Bootstrap a hybrid Angular 1 / Angular 2+ application.
* *
* This `bootstrap` method is a direct replacement (takes same arguments) for Angular 1
* [`bootstrap`](https://docs.angularjs.org/api/ng/function/angular.bootstrap) method. Unlike
* Angular 1, this bootstrap is asynchronous.
* *
* ### Example
* *
* ```
* const adapter = new UpgradeAdapter(MyNg2Module);
* const module = angular.module('myExample', []);
* module.directive('ng2', adapter.downgradeNg2Component(Ng2));
* *
* module.directive('ng1', function() {
* return {
* scope: { title: '=' },
* template: 'ng1[Hello {{title}}!](<span ng-transclude></span>)'
* };
* });
* *
* *
* selector: 'ng2',
* inputs: ['name'],
* template: 'ng2[<ng1 [title]="name">transclude</ng1>](<ng-content></ng-content>)'
* })
* class Ng2 {
* }
* *
* declarations: [Ng2, adapter.upgradeNg1Component('ng1')],
* imports: [BrowserModule]
* })
* class MyNg2Module {}
* *
* document.body.innerHTML = '<ng2 name="World">project</ng2>';
* *
* adapter.bootstrap(document.body, ['myExample']).ready(function() {
* expect(document.body.textContent).toEqual(
* "ng2[ng1[Hello World!](transclude)](project)");
* });
* ```
* Bootstrap a hybrid Angular 1 / Angular 2+ application.
*
* This `bootstrap` method is a direct replacement (takes same arguments) for Angular 1
* [`bootstrap`](https://docs.angularjs.org/api/ng/function/angular.bootstrap) method. Unlike
* Angular 1, this bootstrap is asynchronous.
*
* ### Example
*
* ```
* const adapter = new UpgradeAdapter(MyNg2Module);
* const module = angular.module('myExample', []);
* module.directive('ng2', adapter.downgradeNg2Component(Ng2));
*
* module.directive('ng1', function() {
* return {
* scope: { title: '=' },
* template: 'ng1[Hello {{title}}!](<span ng-transclude></span>)'
* };
* });
*
*
* \@Component({
* selector: 'ng2',
* inputs: ['name'],
* template: 'ng2[<ng1 [title]="name">transclude</ng1>](<ng-content></ng-content>)'
* })
* class Ng2 {
* }
*
* \@NgModule({
* declarations: [Ng2, adapter.upgradeNg1Component('ng1')],
* imports: [BrowserModule]
* })
* class MyNg2Module {}
*
* document.body.innerHTML = '<ng2 name="World">project</ng2>';
*
* adapter.bootstrap(document.body, ['myExample']).ready(function() {
* expect(document.body.textContent).toEqual(
* "ng2[ng1[Hello World!](transclude)](project)");
* });
* ```
* @param {?} element

@@ -390,30 +399,31 @@ * @param {?=} modules

/**
* Allows Angular 1 service to be accessible from Angular 2+.
* *
* *
* ### Example
* *
* ```
* class Login { ... }
* class Server { ... }
* *
* class Example {
* constructor(@Inject('server') server, login: Login) {
* ...
* }
* }
* *
* const module = angular.module('myExample', []);
* module.service('server', Server);
* module.service('login', Login);
* *
* const adapter = new UpgradeAdapter(MyNg2Module);
* adapter.upgradeNg1Provider('server');
* adapter.upgradeNg1Provider('login', {asToken: Login});
* *
* adapter.bootstrap(document.body, ['myExample']).ready((ref) => {
* const example: Example = ref.ng2Injector.get(Example);
* });
* *
* ```
* Allows Angular 1 service to be accessible from Angular 2+.
*
*
* ### Example
*
* ```
* class Login { ... }
* class Server { ... }
*
* \@Injectable()
* class Example {
* constructor(\@Inject('server') server, login: Login) {
* ...
* }
* }
*
* const module = angular.module('myExample', []);
* module.service('server', Server);
* module.service('login', Login);
*
* const adapter = new UpgradeAdapter(MyNg2Module);
* adapter.upgradeNg1Provider('server');
* adapter.upgradeNg1Provider('login', {asToken: Login});
*
* adapter.bootstrap(document.body, ['myExample']).ready((ref) => {
* const example: Example = ref.ng2Injector.get(Example);
* });
*
* ```
* @param {?} name

@@ -432,21 +442,21 @@ * @param {?=} options

/**
* Allows Angular 2+ service to be accessible from Angular 1.
* *
* *
* ### Example
* *
* ```
* class Example {
* }
* *
* const adapter = new UpgradeAdapter(MyNg2Module);
* *
* const module = angular.module('myExample', []);
* module.factory('example', adapter.downgradeNg2Provider(Example));
* *
* adapter.bootstrap(document.body, ['myExample']).ready((ref) => {
* const example: Example = ref.ng1Injector.get('example');
* });
* *
* ```
* Allows Angular 2+ service to be accessible from Angular 1.
*
*
* ### Example
*
* ```
* class Example {
* }
*
* const adapter = new UpgradeAdapter(MyNg2Module);
*
* const module = angular.module('myExample', []);
* module.factory('example', adapter.downgradeNg2Provider(Example));
*
* adapter.bootstrap(document.body, ['myExample']).ready((ref) => {
* const example: Example = ref.ng1Injector.get('example');
* });
*
* ```
* @param {?} token

@@ -461,16 +471,16 @@ * @return {?}

/**
* Declare the Angular 1 upgrade module for this adapter without bootstrapping the whole
* hybrid application.
* *
* This method is automatically called by `bootstrap()` and `registerForNg1Tests()`.
* *
* Declare the Angular 1 upgrade module for this adapter without bootstrapping the whole
* hybrid application.
*
* This method is automatically called by `bootstrap()` and `registerForNg1Tests()`.
*
* @param {?=} modules The Angular 1 modules that this upgrade module should depend upon.
* @return {?} The Angular 1 upgrade module that is declared by this method
* *
* ### Example
* *
* ```
* const upgradeAdapter = new UpgradeAdapter(MyNg2Module);
* upgradeAdapter.declareNg1Module(['heroApp']);
* ```
*
* ### Example
*
* ```
* const upgradeAdapter = new UpgradeAdapter(MyNg2Module);
* upgradeAdapter.declareNg1Module(['heroApp']);
* ```
*/

@@ -567,6 +577,2 @@ UpgradeAdapter.prototype.declareNg1Module = function (modules) {

_this.moduleRef = ref;
var /** @type {?} */ subscription = _this.ngZone.onMicrotaskEmpty.subscribe({
next: function (_) { return _this.ngZone.runOutsideAngular(function () { return rootScope.$evalAsync(); }); }
});
rootScope.$on('$destroy', function () { subscription.unsubscribe(); });
_this.ngZone.run(function () {

@@ -582,3 +588,7 @@ if (rootScopePrototype) {

})
.then(function () { return _this.ng2BootstrapDeferred.resolve(ng1Injector); }, onError);
.then(function () { return _this.ng2BootstrapDeferred.resolve(ng1Injector); }, onError)
.then(function () {
var /** @type {?} */ subscription = _this.ngZone.onMicrotaskEmpty.subscribe({ next: function () { return rootScope.$digest(); } });
rootScope.$on('$destroy', function () { subscription.unsubscribe(); });
});
})

@@ -599,6 +609,7 @@ .catch(function (e) { return _this.ng2BootstrapDeferred.reject(e); });

* An internal map of ng1 components which need to up upgraded to ng2.
* *
*
* We can't upgrade until injector is instantiated and we can retrieve the component metadata.
* For this reason we keep a list of components to upgrade until ng1 injector is bootstrapped.
* *
*
* \@internal
* @type {?}

@@ -623,4 +634,4 @@ */

/**
* Synchronous promise-like object to wrap parent injectors,
* to preserve the synchronous nature of Angular 1's $compile.
* Synchronous promise-like object to wrap parent injectors,
* to preserve the synchronous nature of Angular 1's $compile.
*/

@@ -757,4 +768,5 @@ var ParentInjectorPromise = (function () {

/**
* Use `UpgradeAdapterRef` to control a hybrid Angular 1 / Angular 2+ application.
* *
* Use `UpgradeAdapterRef` to control a hybrid Angular 1 / Angular 2+ application.
*
* \@stable
*/

@@ -782,7 +794,7 @@ export var UpgradeAdapterRef = (function () {

/**
* Register a callback function which is notified upon successful hybrid Angular 1 / Angular 2+
* application has been bootstrapped.
* *
* The `ready` callback function is invoked inside the Angular 2+ zone, therefore it does not
* require a call to `$apply()`.
* Register a callback function which is notified upon successful hybrid Angular 1 / Angular 2+
* application has been bootstrapped.
*
* The `ready` callback function is invoked inside the Angular 2+ zone, therefore it does not
* require a call to `$apply()`.
* @param {?} fn

@@ -793,3 +805,3 @@ * @return {?}

/**
* Dispose of running hybrid Angular 1 / Angular 2+ application.
* Dispose of running hybrid Angular 1 / Angular 2+ application.
* @return {?}

@@ -816,3 +828,3 @@ */

/**
* Sort a set of DOM nodes that into groups based on the given content selectors
* Sort a set of DOM nodes that into groups based on the given content selectors
* @param {?} ngContentSelectors

@@ -819,0 +831,0 @@ * @param {?} childNodes

@@ -178,3 +178,3 @@ /**

/**
* Upgrade ng1 components into Angular 2.
* Upgrade ng1 components into Angular 2.
* @param {?} exportedComponents

@@ -181,0 +181,0 @@ * @param {?} injector

/**
* @license undefined
* Copyright Google Inc. All Rights Reserved.
* *
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
* @param {?} e

@@ -8,0 +8,0 @@ * @return {?}

@@ -12,3 +12,3 @@ /**

*/
export var /** @type {?} */ VERSION = new Version('4.0.0-beta.3');
export var /** @type {?} */ VERSION = new Version('4.0.0-beta.4');
//# sourceMappingURL=version.js.map

@@ -1,1 +0,1 @@

[{"__symbolic":"module","version":3,"metadata":{"VERSION":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"Version"},"arguments":["4.0.0-beta.3"]}}},{"__symbolic":"module","version":1,"metadata":{"VERSION":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"Version"},"arguments":["4.0.0-beta.3"]}}}]
[{"__symbolic":"module","version":3,"metadata":{"VERSION":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"Version"},"arguments":["4.0.0-beta.4"]}}},{"__symbolic":"module","version":1,"metadata":{"VERSION":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"Version"},"arguments":["4.0.0-beta.4"]}}}]

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc