Skip to content

Commit ff41227

Browse files
committed
feat(controller): use "controller as vm" syntax
See http://www.johnpapa.net/angularjss-controller-as-and-the-vm-variable/ for moar infos on why it's better
1 parent 8faed06 commit ff41227

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

route/templates/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ angular.module('<%= _.camelize(appname) %>')
66
.when('<%= route %>', {
77
templateUrl: 'views/<%= _.slugify(name) %>/<%= _.slugify(name) %>.html',
88
controller: '<%= _.capitalize(_.camelize(name)) %>Ctrl',
9-
controllerAs: '<%= _.camelize(name) %>'
9+
controllerAs: 'vm'
1010
});
1111
});

route/templates/view.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<div>
2-
controller {{ <%= _.camelize(name) %>.name }} ready !
2+
controller {{ vm.name }} ready !
33
</div>

0 commit comments

Comments
 (0)