添加自定义过滤器后,范围值将从UI中消失

时间:2017-03-22 21:39:17

标签: angularjs

我的UI看起来像这样

Country [Click for Asia] [Click for Europe]
Japan
China
Italy

Country [Click for Asia] [Click for Europe]
India
Korea
France

当我点击Click of Asia或Click of Europe时,我希望看到亚洲或欧洲国家的结果[myFilter被激活]

点击动作如下所示。如你所见,我发送"这个"值,因为我希望更改只反映在子集上

<button data-style="slide-right" data-spinner-color=#006b24 ng-click="Activate(this,'Asia')>

功能

$scope.Activate = function (repeatScope,filter) {
         console.log(repeatScope);

         temp = [];
         angular.forEach(repeatScope.value, function (value,key) {
                if (repeatScope.value[key].continent == filter) {
                    temp.push(repeatScope.value[key]);
                }
            });
         repeatScope.myfilter = temp;

         console.log(repeatScope.myfilter);

        };

repeatScope.myfilter按预期打印该值,但UI变为完全空白。

请告诉我这里的错误

0 个答案:

没有答案