vendredi 18 janvier 2019

Angular 2 How to bind the checkbox dynamically and return checked checkbox id's when Submit button is clicked

I have a JSON data like I shown below,

[  
         {  
            "id":1,
            "applicationId":1,
            "permissions":"Edit"
         },
         {  
            "id":2,
            "applicationId":1,
            "permissions":"View"
         }
]

Now I need to bind the checkbox dynamically for the data "permissions" and there is a button in HTML to Submit and when I click on Submit button, I need all the applicationId's which are checked in an array.

How can I achieve this in Angular?




Aucun commentaire:

Enregistrer un commentaire