Filter NOT equals in AngularJS

前端 未结 3 1910
囚心锁ツ
囚心锁ツ 2020-12-21 04:55

I have a array of objects, in client side. The object in array look like this:

{
    code: 0,
    short_name: \'a\',
    type: 1
}

I try to

3条回答
  •  [愿得一人]
    2020-12-21 05:16

    You're very close. You just need to change your second filter to:

    $scope.array2 = $filter('filter')(data, { type: '!1' });
    

    I also renamed the scope variable since otherwise it would just overwrite your first filtered array.

提交回复
热议问题