Skip to content

Commit 87bfebb

Browse files
committed
renamed DirController to ExampleController. Replaced ngInject with manual injection , since it had not been discussed yet in this doc
1 parent f27a91d commit 87bfebb

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
*Opinionated AngularJS style guide for teams by [@john_papa](//twitter.com/john_papa)*
44

5-
If you are looking for an opinionated style guide for syntax, conventions, and structuring AngularJS applications, then step right in. The styles contained here are based on my experience with [AngularJS](//angularjs.org), presentations, [Pluralsight training courses] (http://pluralsight.com/training/Authors/Details/john-papa) and working in teams.
5+
If you are looking for an opinionated style guide for syntax, conventions, and structuring AngularJS applications, then step right in. The styles contained here are based on my experience with [AngularJS](//angularjs.org), presentations, [Pluralsight training courses](http://pluralsight.com/training/Authors/Details/john-papa) and working in teams.
66

77
The purpose of this style guide is to provide guidance on building AngularJS applications by showing the conventions I use and, more importantly, why I choose them.
88

@@ -1089,13 +1089,13 @@ While this guide explains the *what*, *why* and *how*, I find it helpful to see
10891089
max: '='
10901090
},
10911091
link: linkFunc,
1092-
controller : DirController,
1092+
controller : ExampleController,
10931093
controllerAs: 'vm'
10941094
};
10951095
return directive;
10961096

1097-
/* @ngInject */
1098-
function DirController($scope) {
1097+
ExampleController.$inject = ['$scope'];
1098+
function ExampleController($scope) {
10991099
// Injecting $scope just for comparison
11001100
/* jshint validthis:true */
11011101
var vm = this;
@@ -1107,7 +1107,6 @@ While this guide explains the *what*, *why* and *how*, I find it helpful to see
11071107
console.log('CTRL: vm.max = %i', vm.max);
11081108
}
11091109

1110-
/* @ngInject */
11111110
function linkFunc(scope, el, attr, ctrl) {
11121111
console.log('LINK: scope.max = %i', scope.max);
11131112
console.log('LINK: scope.vm.min = %i', scope.vm.min);

0 commit comments

Comments
 (0)