當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。