回答編集履歴
1
サンプルコードの誤記修正
test
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
|
11
11
|
app.filter("myfilter", function() {
|
12
12
|
|
13
|
-
return function(value, index) {
|
13
|
+
return function(value, index, $scope) {
|
14
14
|
|
15
15
|
$scope.data = $scope.data || {};
|
16
16
|
|
@@ -28,7 +28,7 @@
|
|
28
28
|
|
29
29
|
```HTML
|
30
30
|
|
31
|
-
<p ng-repeat="item in items" ng-bind="item.value|myfilter:$index"></p>
|
31
|
+
<p ng-repeat="item in items" ng-bind="item.value|myfilter:$index:this"></p>
|
32
32
|
|
33
33
|
```
|
34
34
|
|