本文整理汇总了TypeScript中angular2/core.coreLoadAndBootstrap函数的典型用法代码示例。如果您正苦于以下问题:TypeScript coreLoadAndBootstrap函数的具体用法?TypeScript coreLoadAndBootstrap怎么用?TypeScript coreLoadAndBootstrap使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了coreLoadAndBootstrap函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it("should be able to bootstrap", () => {
return coreLoadAndBootstrap(appInjector, TestApp)
.then(cmpRef => {
console.log("boostrapped!");
assert(!!cmpRef);
});
});
示例2: bootstrapApp
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);
}
示例3: bootstrap
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);
}
示例4: bootstrapStatic
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);
}
示例5: createPlatform
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