這裏是我的collegue的工作例如:
angularJsWrapperComponent.ts(新角度分量):
...
template: `
<angular-js-component
[(canDeactivate)]="this.canDeactivate">
</angular-js-component>`
...
export class AngularJsWrapperComponent implements {
private canDeactivate: boolean;
...
angularJsWrapperComponentDirective.ts:
...
@Directive({ selector: 'angular-js-component' })
export class AngularJsComponentWrapperDirective extends UpgradeComponent {
@Input() canDeactivate: boolean;
@Output() canDeactivateChange: EventEmitter<boolean>;
constructor(elementRef: ElementRef, injector: Injector) {
super('originalAngularJsComponent', elementRef, injector);
}
}
...
originalAngularJsComponent.ts(你r你想升級的AngularJs組件):
...
bindings: {
canDeactivate: '='
}
...
你可以添加重擊嗎? – deen
當您詢問有關由您的代碼引起的問題的問題時,如果您提供可用於重現該問題的代碼,您將得到更好的答案。請參見[如何創建最小,完整和可驗證示例](http://stackoverflow.com/help/mcve)。 – georgeawg