How do i filter object into array in Angular2/ ionic 2?
sample result data in object
`
{“products”:[{“title”:“Smirnoff Red Two - 750ml”,“id”:216,“created_at”:“2015-06-18T06:15:40Z”,“updated_at”:“2016-04-11T03:29:13Z”,“type”:“simple”}]}
`
How do i filter object into array in Angular2/ ionic 2?
sample result data in object
`
{“products”:[{“title”:“Smirnoff Red Two - 750ml”,“id”:216,“created_at”:“2015-06-18T06:15:40Z”,“updated_at”:“2016-04-11T03:29:13Z”,“type”:“simple”}]}
`
I not tested here now, but try:
one = {"products":[{"title":"Smirnoff Red Two - 750ml","id":216,"created_at":"2015-06-18T06:15:40Z","updated_at":"2016-04-11T03:29:13Z","type":"simple"}]};
two = Object.keys(one).map(function (key) {return one[key]});