ngUpgraders / ng-forward

The default solution for those that want to write Angular 2.x style code in Angular 1.x
411 stars 36 forks source link

Angular 2 equivalents for ng1 directives #5

Open timkindberg opened 9 years ago

timkindberg commented 9 years ago

We should consider creating special directives to replace all the common angular 1 directives, but where they look like element property binding is working. It would of course be a ruse. This only included non-template directives (so things like ng-repeat, ng-if, ng-include are not included here).

ngBind -> [textContent] ngBindHtml -> [innerHTML] ngClass -> [class] ngChecked -> [checked] ngDisabled -> [disabled] ngShow, ngHide -> [visible] ngModel -> [value] ngReadOnly -> [readOnly] ngSelected -> [selected] ngSrc -> [src] ngSrcSet -> [srcSet] ngStyle -> [style]

aciccarello commented 9 years ago

I like this because it enables changing syntax to prepare for ng2. I do think some performance checks should be done. If the new [] directives simply add the corresponding ngX directive, I could see this causing extra digest cycles. Could they somehow tie in to the existing implementations?