本文整理匯總了TypeScript中@angular/platform-server.serverPlatform函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript serverPlatform函數的具體用法?TypeScript serverPlatform怎麽用?TypeScript serverPlatform使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了serverPlatform函數的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: it
it('should support basic content projection', () => {
const appInjector =
ReflectiveInjector.resolveAndCreate(BROWSER_APP_PROVIDERS, serverPlatform().injector);
var compWithPrecompile = CompWithPrecompileNgFactory.create(appInjector).instance;
var cf = compWithPrecompile.cfr.resolveComponentFactory(SomeComp);
expect(cf.componentType).toBe(SomeComp);
});
示例2: createModule
export function createModule(): NgModuleRef<MainModule> {
return bootstrapModuleFactory(MainModuleNgFactory, serverPlatform());
}
示例3: beforeEach
beforeEach((done) => {
serverPlatform().bootstrapModuleFactory(MainModuleNgFactory).then((moduleRef) => {
mainModuleRef = moduleRef;
done();
});
});
示例4: bootstrapModuleFactory
export function createModule<M>(factory: AppModuleFactory<M>): AppModuleRef<M> {
return bootstrapModuleFactory(factory, serverPlatform());
}
示例5:
export function createModule<M>(factory: AppModuleFactory<M>): AppModuleRef<M> {
return factory.create(serverPlatform().injector);
}