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


TypeScript UpgradeAdapter.upgradeNg1Provider方法代码示例

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


在下文中一共展示了UpgradeAdapter.upgradeNg1Provider方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: UpgradeAdapter

import { UpgradeAdapter } from '@angular/upgrade';
import { uiRouterNgUpgrade } from 'ui-router-ng1-to-ng2';
import { forwardRef } from '@angular/core';
import { Angular2UaaGatewayAppModule } from './app.ng2module';

export var upgradeAdapter: UpgradeAdapter = new UpgradeAdapter(forwardRef(() => Angular2UaaGatewayAppModule));
uiRouterNgUpgrade.setUpgradeAdapter(upgradeAdapter);
upgradeAdapter.upgradeNg1Provider('$stateParams');
upgradeAdapter.upgradeNg1Provider('$uibModal');
upgradeAdapter.upgradeNg1Provider('$state');
upgradeAdapter.upgradeNg1Provider('$rootScope');
upgradeAdapter.upgradeNg1Provider('tmhDynamicLocale');
开发者ID:xetys,项目名称:jhipster-uaa-setup,代码行数:12,代码来源:upgrade_adapter.ts

示例2: UpgradeAdapter

// #enddocregion phone-service
// #docregion phone-list
import { PhoneListComponent } from './phone-list/phone-list.component';

// #enddocregion phone-list
// #docregion phone-detail
import { PhoneDetailComponent } from './phone-detail/phone-detail.component';

// #enddocregion phone-detail
// #docregion init-adapter
let upgradeAdapter = new UpgradeAdapter(AppModule);
// #enddocregion init-adapter

// #docregion routeparams
upgradeAdapter.upgradeNg1Provider('$routeParams');
// #enddocregion routeparams

// #docregion phone-service

angular.module('core.phone')
  .factory('phone', upgradeAdapter.downgradeNg2Provider(Phone));
// #enddocregion phone-service
// #docregion phone-list

angular.module('phoneList')
  .directive(
    'phoneList',
    upgradeAdapter.downgradeNg2Component(PhoneListComponent) as angular.IDirectiveFactory
  );
// #enddocregion phone-list
开发者ID:rahulchaturvedie,项目名称:angular.io,代码行数:30,代码来源:main.ts

示例3:

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

angular.module('interestApp')
  .factory('AnalyticsService',
           upgradeAdapter.downgradeNg2Provider(AnalyticsService));

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

@NgModule({
  declarations: [
    PinControlsComponent,
    AddPinComponent
  ],
  imports: [
    CommonModule,
    BrowserModule,
    FormsModule
  ],
  providers: [
    AnalyticsService,
  ]
开发者ID:hixiaoguan,项目名称:Ionic,代码行数:31,代码来源:app.ts

示例4: extract

  extract(url) {
    return url;
  }

  merge(url, whole) {
    return url;
  }
}

@NgModule({
  imports: [BrowserModule, RouterModule.forRoot(FISH_ROUTES, {useHash: true})],
  providers: [
    { provide: UrlHandlingStrategy, useClass: Ng1Ng2UrlHandlingStrategy }
  ],
  declarations: [DolphinCmp, WhaleCmp, ModuleRootCmp, BlankCmp]
})
class AppModule {}

export const adapter = new UpgradeAdapter(AppModule);

adapter.upgradeNg1Provider('urlService');
configureModuleRoot(adapter, FishModule);
export const bootstrap = (el) => {
  const ref = adapter.bootstrap(el, [ 'rootModule' ]);

  setTimeout(() => {
    ref.ng2Injector.get(Router).initialNavigation();
  }, 0);
};

开发者ID:vsavkin,项目名称:upgrade-demo,代码行数:29,代码来源:app.ts


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