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


TypeScript upgrade.UpgradeAdapter类代码示例

本文整理汇总了TypeScript中angular2/upgrade.UpgradeAdapter的典型用法代码示例。如果您正苦于以下问题:TypeScript UpgradeAdapter类的具体用法?TypeScript UpgradeAdapter怎么用?TypeScript UpgradeAdapter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了UpgradeAdapter类的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';
import * as angular from 'angular2/src/upgrade/angular_js';
import 'PinerestApp_ng1';
import { PinOverlay } from './home/pin/pin-overlay/pin-overlay';
import { UploadComponent } from './upload-component/upload-component';
import { AnalyticsService } from './_components/analytics-service';



const upgradeAdapter:UpgradeAdapter = new UpgradeAdapter();







// Expose our ng2 content to ng1
upgradeAdapter.addProvider(AnalyticsService);

angular.module('PinerestApp')
  .directive('pinOverlay', upgradeAdapter.downgradeNg2Component(PinOverlay))
  .directive('uploadComponent', upgradeAdapter.downgradeNg2Component(UploadComponent))
  .factory('analyticsService', upgradeAdapter.downgradeNg2Provider(AnalyticsService));


// Expose our ng1 content to ng2
upgradeAdapter.upgradeNg1Provider('pinsService');
upgradeAdapter.upgradeNg1Provider('$state');

开发者ID:ghcpc10,项目名称:photo-gallery-ng12,代码行数:29,代码来源:app-ng2.ts

示例7: UpgradeAdapter

import {UpgradeAdapter} from 'angular2/upgrade';

var adapter = new UpgradeAdapter();

adapter.bootstrap(document.body, ['urf3']);
开发者ID:zealenth,项目名称:urf3,代码行数:5,代码来源:boot.ts

示例8: UpgradeAdapter

// Angular 2 Vendor Import
import {UpgradeAdapter} from 'angular2/upgrade';

// Instantiate the adapter singleton
export const upgradeAdapter = new UpgradeAdapter();

// upgrade an Angular 1 component
export const a1Upgradable = upgradeAdapter.upgradeNg1Component('a1Upgradable');

// share an Angular 2 service with Angular 1
import {A2DowngradeService} from './services/a2-downgrade-service'
upgradeAdapter.addProvider(A2DowngradeService);

// share an Angular 1 servie with Angular 2
upgradeAdapter.upgradeNg1Provider('a1UpgradeService');
开发者ID:Hachero,项目名称:ngCourse2,代码行数:15,代码来源:upgrade-adapter.ts

示例9: 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


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