试图将Angularj1.5组件导入Angularjs2.0可能吗?

时间:2017-05-23 16:16:56

标签: angularjs angular ng-upgrade

我正处于从Angular1迁移到Angular2的过程中。

我可以轻松地在angular1中导入angular2组件,但我无法在Angularj2中运行Angularjs1组件并收到错误消息“在AngularOneComponet上找不到指令注释”

从错误消息中,似乎无法在angular2 componnet上运行angular1组件,但如果有人知道如何让它工作,请告诉我。

ComponetA.module

import { AngularOneComponet } from '../common/angularOne.components';

export default angular
  .module('ComponetA')
  .config(componentAConfig)
  .component('angularOneComponent', AngularOneComponet);


ComponetA.component

import { AngularOneComponent } from '../common/angularOne.component';

@Component{{
  selector: 'component-a',
  template: '
    <angular-one-component></angular-one-component>
  ',
  directives: [AngularOneComponent]
})
export class ComponentA{
}

0 个答案:

没有答案