當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript UpgradeAdapter.bootstrap方法代碼示例

本文整理匯總了TypeScript中angular2/upgrade.UpgradeAdapter.bootstrap方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript UpgradeAdapter.bootstrap方法的具體用法?TypeScript UpgradeAdapter.bootstrap怎麽用?TypeScript UpgradeAdapter.bootstrap使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在angular2/upgrade.UpgradeAdapter的用法示例。


在下文中一共展示了UpgradeAdapter.bootstrap方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: UpgradeAdapter

import { UpgradeAdapter } from 'angular2/upgrade';
import * as angular from 'angular2/src/upgrade/angular_js';
import 'interestAppNg1'; // "bare import" for side-effects
import { Pin, PinsService } from 'interestAppNg1';
import { PinControlsComponent } from './components/PinControlsComponent';


/*
 * Create our upgradeAdapter
 */
const upgradeAdapter: UpgradeAdapter = new UpgradeAdapter();



/*
 * Expose our ng2 content to ng1
 */
angular.module('interestApp')
    .directive('pinControls',
        upgradeAdapter.downgradeNg2Component(PinControlsComponent));

/**
 * Bootstrap the app
 */

upgradeAdapter.bootstrap(document.body, ['interestApp']);
開發者ID:russellf9,項目名稱:angular2-convert,代碼行數:26,代碼來源:app.ts

示例2: UpgradeAdapter

import {UpgradeAdapter} from 'angular2/upgrade';
import {MainController} from './main.controller';
import {HeroDetailComponent} from './hero-detail.component';

declare var angular:any;
const upgradeAdapter = new UpgradeAdapter();

angular.module('heroApp', [])
  .controller('MainController', MainController)
  .directive('heroDetail', upgradeAdapter.downgradeNg2Component(HeroDetailComponent));

upgradeAdapter.bootstrap(
  document.querySelector('hero-app'),
  ['heroApp'],
  {strictDi: true}
);
開發者ID:Bachmann1234,項目名稱:angular.io,代碼行數:16,代碼來源:app.module.ts

示例3: UpgradeAdapter

import 'zone.js';
import 'reflect-metadata';
import {Component} from 'angular2/core';
import {UpgradeAdapter} from 'angular2/upgrade';
import {bootstrap} from 'angular2/platform/browser';
import * as angular from 'angular';
const upgradeAdapter = new UpgradeAdapter();

var app = angular.module('ExampleModule');

// olNavBar NG2 -> NG1 //
import {SomeComponent} from '/ng2/someComponent';
app.directive('someComponent', upgradeAdapter.downgradeNg2Component(SomeComponent));

import {Bridge} from '/bridge/bridge';
upgradeAdapter.addProvider(Bridge);
app.factory('Bridge', upgradeAdapter.downgradeNg2Provider(Bridge))

// bootstrapping the app with NG2
upgradeAdapter.bootstrap(document.body, ['ExampleModule']);
開發者ID:Bolza,項目名稱:angular2-bridge,代碼行數:20,代碼來源:main.ts

示例4: UpgradeAdapter

import {UpgradeAdapter} from 'angular2/upgrade';
import {CityComponent} from 'app/city.component';

declare var angular:any;
const upgradeAdapter:UpgradeAdapter = new UpgradeAdapter();

// De Angular 2-component CityComponent binnen de Angular 1-applicatie bekend maken als directive.
// Gebruik hiervoor upgradeAdapter.downgradeNg2Component(CityComponent)
angular.module('myApp')
	.directive('cityComponent',
		upgradeAdapter.downgradeNg2Component(CityComponent));

// De Angular 1-applicatie bootstrappen op de body. 'myApp' is al gedefinieerd in index.html
upgradeAdapter.bootstrap(document.body, ['myApp']);
開發者ID:shosseini,項目名稱:voorbeeldenAngular2,代碼行數:14,代碼來源:app.module.ts

示例5: UpgradeAdapter

import {UpgradeAdapter} from 'angular2/upgrade';
import {AppComponent} from './app.component'

export const upgradeAdapter = new UpgradeAdapter();

angular.module('ng2', [])
.directive('myApp', upgradeAdapter.downgradeNg2Component(AppComponent));

upgradeAdapter.bootstrap(document.documentElement, ['myApp']);

// bootstrap(AppComponent);


/*
Copyright 2016 Google Inc. All Rights Reserved.
Use of this source code is governed by an MIT-style license that
can be found in the LICENSE file at http://angular.io/license
*/
開發者ID:ragutouch,項目名稱:AngularJS,代碼行數:18,代碼來源:main.ts

示例6: UpgradeAdapter

import {UpgradeAdapter} from 'angular2/upgrade';

var adapter = new UpgradeAdapter();

adapter.bootstrap(document.body, ['urf3']);
開發者ID:zealenth,項目名稱:urf3,代碼行數:5,代碼來源:boot.ts

示例7: bootstrap

import {bootstrap}         from 'angular2/platform/browser';
import {UpgradeAdapter} from 'angular2/upgrade';
// Add all operators to Observable
import 'rxjs/Rx';

import {WikiComponent}        from './wiki/wiki.component';
import {WikiSmartComponent}   from './wiki/wiki-smart.component';
import {TohComponent}         from './toh/toh.component';

bootstrap(WikiComponent);
bootstrap(WikiSmartComponent);
bootstrap(TohComponent);

var adapter = new UpgradeAdapter();
//var app = angular.module('app', []);

adapter.bootstrap(document.body, ['app']);

/*
 Copyright 2016 Google Inc. All Rights Reserved.
 Use of this source code is governed by an MIT-style license that
 can be found in the LICENSE file at http://angular.io/license
 */
開發者ID:saharza,項目名稱:Angular-Gridster-Dashboard-POC,代碼行數:23,代碼來源:main.ts

示例8:

angular
.module('githubExplorerApp')
.directive('repositoryContributors', adapter.downgradeNg2Component(RepositoryContributors));

angular
.module('githubExplorerApp')
.directive('repositoryContent', adapter.downgradeNg2Component(RepositoryContent));

angular
.module('githubExplorerApp')
.directive('main', adapter.downgradeNg2Component(Main));

angular
.module('githubExplorerApp')
.directive('header', adapter.downgradeNg2Component(Header));

angular
.module('githubExplorerApp')
.directive('myProfile', adapter.downgradeNg2Component(MyProfile));

adapter.addProvider(GithubService);

adapter.addProvider(HTTP_PROVIDERS);

adapter.upgradeNg1Provider('dataService');

adapter.upgradeNg1Provider('localStorageService');

adapter.bootstrap(document.body, ['githubExplorerApp']);
開發者ID:SChervonyi,項目名稱:git-explorer,代碼行數:29,代碼來源:bootstrap.ts

示例9: UpgradeAdapter

import {Component} from 'angular2/core';
import {UpgradeAdapter} from 'angular2/upgrade';
import {bootstrap} from 'angular2/platform/browser';
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:2947721120,項目名稱:angular-2-samples,代碼行數:16,代碼來源:upgrade.ts


注:本文中的angular2/upgrade.UpgradeAdapter.bootstrap方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。