本文整理汇总了TypeScript中@angular/upgrade.UpgradeAdapter.bootstrap方法的典型用法代码示例。如果您正苦于以下问题:TypeScript UpgradeAdapter.bootstrap方法的具体用法?TypeScript UpgradeAdapter.bootstrap怎么用?TypeScript UpgradeAdapter.bootstrap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@angular/upgrade.UpgradeAdapter
的用法示例。
在下文中一共展示了UpgradeAdapter.bootstrap方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: setTimeout
export const bootstrap = (el) => {
const ref = adapter.bootstrap(el, [ 'rootModule' ]);
setTimeout(() => {
ref.ng2Injector.get(Router).initialNavigation();
}, 0);
};
示例2: UpgradeAdapter
import {UpgradeAdapter} from '@angular/upgrade';
const adapter = new UpgradeAdapter();
adapter.bootstrap(document.body, ['todoListWorkshopApp']);
示例3: UpgradeAdapter
// #docregion downgradecomponent
import {HeroDetailComponent} from './hero-detail.component';
// #enddocregion downgradecomponent
import {UpgradeAdapter} from '@angular/upgrade';
const upgradeAdapter = new UpgradeAdapter();
// #docregion downgradecomponent
angular.module('heroApp', [])
.directive('heroDetail', upgradeAdapter.downgradeNg2Component(HeroDetailComponent));
// #enddocregion downgradecomponent
upgradeAdapter.bootstrap(
document.querySelector('hero-app'),
['heroApp'],
{strictDi: true}
);
// #enddocregion bootstrap
示例4:
/*
* Expose our ng1 content to ng2
*/
upgradeAdapter.upgradeNg1Provider('PinsService');
upgradeAdapter.upgradeNg1Provider('$state');
@NgModule({
declarations: [
PinControlsComponent,
AddPinComponent
],
imports: [
CommonModule,
BrowserModule,
FormsModule
],
providers: [
AnalyticsService,
]
})
class InterestAppModule { }
/*
* Bootstrap the App
*/
upgradeAdapter.bootstrap(document.body, ['interestApp']);
示例5: onReady
function onReady() {
adapter.bootstrap(document.body, [
SociallyNg1Module.name
]);
}
示例6: UpgradeAdapter
import {Component} from '@angular/core';
import {UpgradeAdapter} from '@angular/upgrade';
import {bootstrap} from '@angular/platform-browser-dynamic';
import {Algorithms} from './components/algorithms/algorithms';
import {Adder} from './components/adder/adder';
import {Counter} from './components/counter/counter';
declare var angular:any;
var adapter: UpgradeAdapter = new UpgradeAdapter();
angular.module('angular-legacy').directive('algorithms',adapter.downgradeNg2Component(Algorithms));
angular.module('angular-legacy').directive('add',adapter.downgradeNg2Component(Adder));
angular.module('angular-legacy').directive('counterButton',adapter.downgradeNg2Component(Counter));
adapter.bootstrap(document.body, ['angular-legacy']);
示例7: UpgradeAdapter
/**
* Created by ranwahle on 09/08/2016.
*/
import "angular";
import { UpgradeAdapter } from '@angular/upgrade';
import './app';
import {ChatService} from "./services/chatService";
let upgradeAdapter = new UpgradeAdapter();
upgradeAdapter.addProvider(ChatService);
angular.module('chatApp.chatService',[])
.service('chatService', upgradeAdapter.downgradeNg2Provider(ChatService));
upgradeAdapter.bootstrap(document.documentElement, ['chatApp']);
示例8: function
declare var angular:any;
// #docregion bootstrap
import { UpgradeAdapter } from '@angular/upgrade';
// #enddocregion bootstrap
angular.module('heroApp', [])
.controller('MainCtrl', function() {
this.message = 'Hello world';
});
// #docregion bootstrap
const upgradeAdapter = new UpgradeAdapter();
upgradeAdapter.bootstrap(document.body, ['heroApp'], {strictDi: true});
// #enddocregion bootstrap
示例9:
export const bootstrap = (el) => adapter.bootstrap(el, ['ng1-module']);
示例10: UpgradeAdapter
import { CarouselTitle } from './app/carousel-title/carousel-title';
import { KittensCarouselComponent, KITTENS_PROVIDERS } from './app/kittens-carousel/kittens-carousel';
import { StoreService } from './app/shared/store.service';
// enableProdMode()
// bootstrap(App, [
// HTTP_PROVIDERS,
// APP_ROUTER_PROVIDERS,
// { provide: LocationStrategy, useClass: HashLocationStrategy }
// ])
// .catch(err => console.error(err));
/*
* Create our upgradeAdapter
*/
const upgradeAdapter: UpgradeAdapter = new UpgradeAdapter();
upgradeAdapter.addProvider(KITTENS_PROVIDERS);
upgradeAdapter.addProvider(StoreService);
angular.module('cdl-kittens')
.directive('cdlCarouselTitle',
upgradeAdapter.downgradeNg2Component(CarouselTitle))
.directive('cdlKittensCarousel',
upgradeAdapter.downgradeNg2Component(KittensCarouselComponent))
.factory('store',
upgradeAdapter.downgradeNg2Provider(StoreService));
upgradeAdapter.bootstrap(document.body, ['cdl-kittens']);