本文整理汇总了TypeScript中angular2-meteor-auto-bootstrap.bootstrap函数的典型用法代码示例。如果您正苦于以下问题:TypeScript bootstrap函数的具体用法?TypeScript bootstrap怎么用?TypeScript bootstrap使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bootstrap函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: runWeb
function runWeb() {
bootstrap(AppWebComponent, [
disableDeprecatedForms(),
provideForms(),
APP_ROUTER_PROVIDERS,
GOOGLE_MAPS_PROVIDERS
]);
}
示例2: ionicProviders
Meteor.startup(function() {
// define array of bootstrap providers
let providers = ionicProviders(args).concat(args.providers || [], METEOR_PROVIDERS);
// bootstrap angular2
bootstrap(cls, providers).then(appRef => {
appRef.injector.get(TapClick);
let app: IonicApp = appRef.injector.get(IonicApp);
app.setProd(args.prodMode);
});
});
示例3: generateData
generateData().then(() => {
bootstrap(Todos).then(compRef => {
let ngZone = compRef.injector.get(NgZone);
onStable(ngZone, () => {
DataObserver.onReady(() => {
onStable(ngZone, () => {
expect($('.task', el).size()).to.equal(10);
done();
});
})
});
});
})
示例4: ionicProviders
Meteor.startup(function() {
// define array of bootstrap providers
let providers = ionicProviders(args).concat(args.providers || [], METEOR_PROVIDERS);
// auto add Ionic directives
let directives = args.directives ? args.directives.concat(IONIC_DIRECTIVES) : IONIC_DIRECTIVES;
// automatically provide all of Ionic's directives to every component
providers.push(provide(PLATFORM_DIRECTIVES, { useValue: [directives], multi: true }));
if (args.prodMode) {
enableProdMode();
}
bootstrap(cls, providers).then( appRef => {
postBootstrap(appRef, args.prodMode);
});
return cls;
});
示例5: constructor
constructor(private router: Router) {
super();
this.autorun(() => {
this.idUser = Meteor.userId();
});
}
logout() {
let user = Meteor.users.findOne(Meteor.userId());
Meteor.users.update(
{
_id: user._id
}, {
$set: {
profile: {
name: user.profile.name,
status: 'offline'
}
}
}
);
Meteor.logout();
this.router.navigate(['Login']);
}
}
bootstrap(Socially, [ROUTER_PROVIDERS, HTTP_PROVIDERS, provide(APP_BASE_HREF, { useValue: '/' })]);
示例6: bootstrap
import { bootstrap } from 'angular2-meteor-auto-bootstrap';
import { App } from './app.component';
bootstrap( App );
示例7: constructor
import {MeteorComponent} from 'angular2-meteor/meteor_component';
import {bootstrap} from 'angular2-meteor-auto-bootstrap';
import {Parties} from '../collections/parties';
import {Mongo} from 'meteor/mongo';
import {AddItemsComponent} from './addItem';
@Component({
selector: 'app',
templateUrl: 'client/app.html',
directives: [AddItemsComponent]
})
class AngTwoMeteorApp extends MeteorComponent implements OnInit {
parties: Mongo.Cursor<Object>;
constructor() {
super();
}
ngOnInit() {
console.log('ngOnInit');
this.subscribe('parties', () => {
this.parties = Parties.find();
}, true);
}
}
bootstrap(AngTwoMeteorApp);
示例8: constructor
import reflectMetadata from 'reflect-metadata';
import angular from 'angular';
import angularMeteor from 'angular-meteor';
import { Component } from '@angular/core';
import { bootstrap } from 'angular2-meteor-auto-bootstrap';
import { Parties } from '../collections/parties';
import { Mongo } from 'meteor/mongo';
import template from './app.html';
@Component({
selector: 'app',
template
})
class Socially {
parties: Mongo.Cursor<Object>;
constructor() {
this.parties = Parties.find();
}
}
bootstrap(Socially);
示例9: bootstrap
import 'reflect-metadata';
import 'zone.js/dist/zone';
import { Component, provide } from '@angular/core';
import { bootstrap } from 'angular2-meteor-auto-bootstrap';
import { ROUTER_PROVIDERS, ROUTER_DIRECTIVES, RouteConfig } from '@angular/router-deprecated';
import { APP_BASE_HREF } from '@angular/common';
import { UserForm } from './imports/user-form/user-form.ts';
import { Manager } from './imports/manager/manager.ts';
import '../collections/methods.ts';
@Component({
selector: 'app',
templateUrl: 'client/app.html',
directives: [ROUTER_DIRECTIVES]
})
@RouteConfig([
{ path: '/', as: 'UserForm', component: UserForm , useAsDefault: true},
{ path: '/manager/...', as: 'Manager', component: Manager }
])
class LaundryHelp {}
bootstrap(LaundryHelp, [ROUTER_PROVIDERS, provide(APP_BASE_HREF, { useValue: '/' })]);
示例10: origBoot
Meteor.startup(function() {
origBoot(appComponentType, providers);
Tracker.afterFlush(() => {
if (preboot) preboot.complete();
});
});