1

Hi I have certain amount data related to a customer. I need to get period of transactions of a customer and show to angular2 app.

I have one page with drop down list and output area. In dropdown items are like "Last one month transactions", "Last Three months transactions" and etc.

When I select a one of the item in dropdown I need show the all transactions in output area.

I am unable filter data using the pipes in angular2. Please send your thoughts about it. Thanks in advance.

[{
    productNo:1,
    productName: 'Toys',
    quantity: 2,
    purchaseDate: '2016/17/08'
},
{
    productNo:1,
    productName: 'Shoes',
    quantity: 4,
    purchaseDate: '2016/30/07'
},
{
    productNo:1,
    productName: 'Books',
    quantity: 10,
    purchaseDate: '2016/07/06'
},
{
    productNo:1,
    productName: 'Mobile',
    quantity: 1,
    purchaseDate: '2016/21/06'
}]
Girish
  • 136
  • 1
  • 12
  • you should send purchaseDate as timestamp and show it using pipe, that help you a lot to manipulate dataset... – Daredzik Aug 18 '16 at 08:45
  • Looks like a dup of http://stackoverflow.com/questions/2722159/javascript-how-to-filter-object-array-based-on-attributes – Günter Zöchbauer Aug 18 '16 at 08:45
  • Hi @Daredzik, Could you please elaborate the logic. Once we pass the date to the pipe and how can I get the response. If have any answer please provide us. – Girish Aug 18 '16 at 08:55

0 Answers0