How to read array of json objects using filters in angularjs

vm.updateProducts = [
            {productCode:’03’, locationCode: ’11’, key:’123′, newProductName: ‘Product1’},
            {productCode:’05’, locationCode: ’12’, key:’456′, newProductName: ‘Product2’},
            {productCode:’05’, locationCode: ’13’, key:’789′, newProductName: ‘Product3’},
            {productCode:’50’, locationCode: ’14’, key:’101′, newProductName: ‘Product4’},
        ];
 
 
 
function isDownSell(){
            var myProd = $filter(‘filter’)(vm.updateProducts, { productCode: vm.application.applicationProductList[0].productCode, locationCode: vm.application.applicationProductList[0].locationCode });
                    
            session.set(constants.PRODUCT_NAME, myProd[0].newProductName);
            
            
        }
Advertisements

One thought on “How to read array of json objects using filters in angularjs

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s