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

feat(controllerAs): Set default controllerAs value to 'ctrl'. #105

Closed timkindberg closed 9 years ago

timkindberg commented 9 years ago

feat(controllerAs): Set default controllerAs value to 'ctrl'.

For easier migration to Angular 2 later via simple find/replace. To keep the older behavior set controllerAs to '$auto'.

BREAKING CHANGE:

Before:

@Component({ selector: 'app', template: '{{app.foo}}' })

After:

@Component({ selector: 'app', template: '{{ctrl.foo}}' })

// or

@Component({ selector: 'app', controllerAs: '$auto', template: '{{app.foo}}' })

close #6

timkindberg commented 9 years ago

@MikeRyan52 ready for review. Again thanks for going along with this I know you weren't quite feeling it. I do appreciate it and I feel like its the right thing to do.