Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 98d5885

Browse files
committed
docs(guide/filter): fix example style
* use -Controller suffix * use array annotations
1 parent af042b6 commit 98d5885

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

docs/content/guide/filter.ngdoc

+8-9
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@ function.
8989
The following sample filter reverses a text string. In addition, it conditionally makes the
9090
text upper-case.
9191

92-
<example module="MyReverseModule">
92+
<example module="myReverseModule">
9393
<file name="index.html">
94-
<div ng-controller="Ctrl">
94+
<div ng-controller="Controller">
9595
<input ng-model="greeting" type="text"><br>
9696
No filter: {{greeting}}<br>
9797
Reverse: {{greeting|reverse}}<br>
@@ -100,8 +100,8 @@ text upper-case.
100100
</file>
101101

102102
<file name="script.js">
103-
angular.module('MyReverseModule', []).
104-
filter('reverse', function() {
103+
angular.module('myReverseModule', [])
104+
.filter('reverse', function() {
105105
return function(input, uppercase) {
106106
input = input || '';
107107
var out = "";
@@ -114,11 +114,10 @@ text upper-case.
114114
}
115115
return out;
116116
};
117-
});
118-
119-
function Ctrl($scope) {
120-
$scope.greeting = 'hello';
121-
}
117+
})
118+
.controller('Controller', ['$scope', function($scope) {
119+
$scope.greeting = 'hello';
120+
}]);
122121
</file>
123122
</example>
124123

0 commit comments

Comments
 (0)