@@ -58,6 +58,7 @@ export class UpgradeComponent implements OnInit, OnChanges, DoCheck {
58
58
// We ask for the Angular 1 scope from the Angular 2 injector, since
59
59
// we will put the new component scope onto the new injector for each component
60
60
const $parentScope = injector . get ( $SCOPE ) ;
61
+ // QUESTION: should we create an isolated scope if the scope is only true
61
62
this . $componentScope = $parentScope . $new ( ! ! this . directive . scope ) ;
62
63
63
64
const controllerType = this . directive . controller ;
@@ -81,6 +82,7 @@ export class UpgradeComponent implements OnInit, OnChanges, DoCheck {
81
82
}
82
83
83
84
ngOnInit ( ) {
85
+ // QUESTION: why not just use $compile instead of reproducing parts of it
84
86
if ( ! this . directive . bindToController && this . directive . controller ) {
85
87
this . buildController ( this . directive . controller , this . $componentScope ,
86
88
this . $element , this . directive . controllerAs ) ;
@@ -114,6 +116,7 @@ export class UpgradeComponent implements OnInit, OnChanges, DoCheck {
114
116
postLink ( this . $componentScope , this . $element , attrs , linkController , transcludeFn ) ;
115
117
}
116
118
119
+ // QUESTION: in Angular 1 we only call $onInit if the bindingDestination is the controller
117
120
if ( this . bindingDestination . $onInit ) {
118
121
this . bindingDestination . $onInit ( ) ;
119
122
}
@@ -168,6 +171,7 @@ export class UpgradeComponent implements OnInit, OnChanges, DoCheck {
168
171
if ( directive . terminal ) this . notSupported ( 'terminal' ) ;
169
172
if ( directive . compile ) this . notSupported ( 'compile' ) ;
170
173
const link = directive . link ;
174
+ // QUESTION: why not support link.post?
171
175
if ( typeof link == 'object' ) {
172
176
if ( ( < angular . IDirectivePrePost > link ) . post ) this . notSupported ( 'link.post' ) ;
173
177
}
0 commit comments