当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript UpgradeAdapter.bootstrap方法代码示例

本文整理汇总了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);
};
开发者ID:vsavkin,项目名称:upgrade-demo,代码行数:7,代码来源:app.ts

示例2: UpgradeAdapter

import {UpgradeAdapter} from '@angular/upgrade';

const adapter = new UpgradeAdapter();

adapter.bootstrap(document.body, ['todoListWorkshopApp']);
开发者ID:rozanovz,项目名称:angular2-upgrade-todolist,代码行数:5,代码来源:boot.ts

示例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
开发者ID:Xiahl1990,项目名称:angular.io,代码行数:21,代码来源:app.module.ts

示例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']);


开发者ID:hixiaoguan,项目名称:Ionic,代码行数:27,代码来源:app.ts

示例5: onReady

function onReady() {
  adapter.bootstrap(document.body, [
    SociallyNg1Module.name
  ]);
}
开发者ID:AyushAnandChouksey,项目名称:meteor-angular-socially,代码行数:5,代码来源:main.ts

示例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']);
开发者ID:Domnom,项目名称:angular-2-samples,代码行数:16,代码来源:upgrade.ts

示例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']);
开发者ID:ranwahle,项目名称:FrontEndIL_Migration,代码行数:18,代码来源:main.ts

示例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
开发者ID:2947721120,项目名称:angular-cn-1,代码行数:18,代码来源:app.module.ts

示例9:

export const bootstrap = (el) => adapter.bootstrap(el, ['ng1-module']);
开发者ID:robwormald,项目名称:upgrade-demo,代码行数:1,代码来源:ng1-app.ts

示例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']);
开发者ID:Arahir,项目名称:hybrid-app,代码行数:30,代码来源:main.browser.ts


注:本文中的@angular/upgrade.UpgradeAdapter.bootstrap方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。