angular - Object change detection in array -


i need manually (or automatically) change detect property of object in array. have array of productshops entity in ngfor loop filtered "isnotdeleted" property. when change value of isnotdeleted property angular not detect change.

<ul class="nav nav-tabs">     <li *ngfor="let productshop of product.productshops | filter:'isnotdeleted':true" >         <a href="#categoryassoctab{{productshop.shop.id}}" data-toggle="tab">{{productshop.shop.name}}</a>     </li> </ul> 

edit: pipe implementation:

import {pipe, pipetransform} "@angular/core";  @pipe({     name: 'filter' }) export class filterpipe implements pipetransform{      transform(value:array<any>, property, equal){          let properties = property.split('.')          if(value){             return value.filter(item => {                  let finalvalue:any = item                  properties.foreach(p => {                     finalvalue = finalvalue[p]                 })                  return finalvalue == equal             })         }          return []     }  } 

your pipe should marked not pure, because result of transformation given input can change though input hasn't changed.

@pipe({     name: 'filter',     pure: false }) 

see


Comments

Popular posts from this blog

php - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -