Skip to content

Commit

Permalink
feat(upgrade): Dedicated NgMetadataUpgradeAdapter bootstrap function (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesHenry authored Oct 16, 2016
1 parent 52fa571 commit f941c71
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/upgrade/upgrade_adapter.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { reflector } from '../core/reflection/reflection';
import { createBootstrapFn } from '../platform/browser_utils';
import { getInjectableName, OpaqueToken } from '../core/di';
import { ProviderLiteral } from '../core/di/provider_util';
import { resolveDirectiveNameFromSelector } from '../facade/lang';
Expand Down Expand Up @@ -34,10 +35,20 @@ export interface UpgradeAdapter {

export class NgMetadataUpgradeAdapter {

bootstrap: Function;

/**
* Store a reference to the instantiated upgradeAdapter
*/
constructor( public _upgradeAdapter: UpgradeAdapterInstance ) {}
constructor( public _upgradeAdapter: UpgradeAdapterInstance ) {
/**
* Used to bootstrap a hybrid Angular 1 and Angular 2 application,
* it is called with a single ng-metadata NgModule
*
* E.g. `upgradeAdapter.bootstrap(NgModule)`
*/
this.bootstrap = createBootstrapFn(this._upgradeAdapter.bootstrap.bind(this._upgradeAdapter));
}

/**
* Used to register an Angular 2 component as a directive on an Angular 1 module,
Expand Down

0 comments on commit f941c71

Please sign in to comment.