it("should be able to bootstrap", () => { return coreLoadAndBootstrap(appInjector, TestApp) .then(cmpRef => { console.log("boostrapped!"); assert(!!cmpRef); }); });
export function bootstrapApp( appComponentType: Type, customProviders?: Array<any /*Type | Provider | any[]*/>): Promise<ComponentRef<any>> { var appInjector = ReflectiveInjector.resolveAndCreate( [WORKER_APP_APPLICATION, isPresent(customProviders) ? customProviders : []], workerAppPlatform().injector); return coreLoadAndBootstrap(appInjector, appComponentType); }
export function bootstrap( appComponentType: Type, customProviders?: Array<any /*Type | Provider | any[]*/>): Promise<ComponentRef> { reflector.reflectionCapabilities = new ReflectionCapabilities(); var appInjector = ReflectiveInjector.resolveAndCreate( [BROWSER_APP_PROVIDERS, isPresent(customProviders) ? customProviders : []], browserPlatform().injector); return coreLoadAndBootstrap(appInjector, appComponentType); }
export function bootstrapStatic(appComponentType: Type, customProviders?: Array<any /*Type | Provider | any[]*/>, initReflector?: Function): Promise<ComponentRef> { if (isPresent(initReflector)) { initReflector(); } let appProviders = isPresent(customProviders) ? [BROWSER_APP_PROVIDERS, customProviders] : BROWSER_APP_PROVIDERS; var appInjector = ReflectiveInjector.resolveAndCreate(appProviders, browserStaticPlatform().injector); return coreLoadAndBootstrap(appInjector, appComponentType); }
import {Component, createPlatform, coreLoadAndBootstrap, ReflectiveInjector} from 'angular2/core'; import {BROWSER_PROVIDERS, BROWSER_APP_PROVIDERS} from 'angular2/platform/browser'; var appProviders: any[] = []; // #docregion longform @Component({selector: 'my-app', template: 'Hello World'}) class MyApp { } var platform = createPlatform(ReflectiveInjector.resolveAndCreate(BROWSER_PROVIDERS)); var appInjector = ReflectiveInjector.resolveAndCreate([BROWSER_APP_PROVIDERS, appProviders], platform.injector); coreLoadAndBootstrap(appInjector, MyApp); // #enddocregion