本文整理匯總了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