本文整理汇总了TypeScript中@angular/platform-browser.bootstrap函数的典型用法代码示例。如果您正苦于以下问题:TypeScript bootstrap函数的具体用法?TypeScript bootstrap怎么用?TypeScript bootstrap使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bootstrap函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: main
export function main() {
bootstrap(AppCmp);
}
示例2: main
export function main() {
bootstrap(RelativeApp);
}
示例3: bootstrap
import {NG_VALIDATORS} from '@angular/common';
import {bootstrap} from '@angular/platform-browser';
let MyApp: Function = null;
let myValidator: any = null;
// #docregion ng_validators
bootstrap(MyApp, [{provide: NG_VALIDATORS, useValue: myValidator, multi: true}]);
// #enddocregion
示例4: bootstrap
import {Component} from '@angular/core';
import {bootstrap} from '@angular/platform-browser';
@Component({selector: 'hello-world', template: 'hello world!!!'})
class HelloWorldComponent {
}
bootstrap(HelloWorldComponent);
示例5: main
document.addEventListener('DOMContentLoaded', function main() {
return bootstrap(ExampleApp, [
...ENV_PROVIDERS
])
.catch(err => console.error(err));
});
示例6: main
export function main() {
bootstrap(AnimateApp);
}
示例7: enableProdMode
import {enableProdMode, SystemJsComponentResolver, ComponentResolver,} from '@angular/core';
import {bootstrap} from '@angular/platform-browser';
import {PeriscopeAppComponent, environment} from './app';
import {RuntimeCompiler} from '@angular/compiler';
import {provideRouter} from '@angular/router';
const routes = [
{
path: '/triage_pr',
component: './app/+triage-pr',
},
{path: '/sync', component: './app/+sync'}
];
if (environment.production) {
enableProdMode();
}
bootstrap(PeriscopeAppComponent, [
provideRouter(routes),
{
provide: ComponentResolver,
useFactory: (r) => new SystemJsComponentResolver(r),
deps: [RuntimeCompiler]
},
]);
示例8: main
export function main() {
bootstrap(ImageDemo);
}
示例9: bootstrap
import {bootstrap} from '@angular/platform-browser';
import {NG_VALIDATORS} from '@angular/common';
import {Provider} from '@angular/core';
let MyApp: Function = null;
let myValidator: any = null;
// #docregion ng_validators
bootstrap(MyApp, [new Provider(NG_VALIDATORS, {useValue: myValidator, multi: true})]);
// #enddocregion