vendredi 4 mars 2016

matching 2 arrays in Angular, with matches as checkboxes

I want to be able to manage User roles in Angular webpage. I have one object which lists all the current roles in the system.

enter image description here

Then based on the a User, I can get his current role in the role.

enter image description here

I can list all the roles as checkboxes, then i want to have the user's checkbox selected based on role. E.g. if he is Reporter and Public, I want those checkbox's selected.

  <label ng-repeat="m in UserDetails">
            <input type="checkbox" ng-model="UserDetails[m]" /> {{m}}
  </label>

In the UserDetails I have all the roles listed. I want the checkboxes selected.




Aucun commentaire:

Enregistrer un commentaire