AngularJS Filter expression replacing with variable instead

بدون دیدگاه


I have a table object and i want to filter out a particular “index” row using filter function as shown below.
However, $controller.expression is not working out.
IF $controller.expression = "3"; it would work. But not

   $controller.expression = "3,4";
   $controller.expression = [3,4];

    $scope.dataToBeTransfer = $scope.myDataTable.filter(function (el) {
   return el.index== $controller.expression;
                                        });

So how do i solve this issue?



لینک منبع

  • نویسنده
    A-brand
  • تعداد بازدید
    13 views
0دیدگاه فرستاده شده است.
شما هم دیدگاه خود را بنویسید