Setting up some permissions. I'd like to be able to set my item.roles as an array. Is this possible? If not what's the smartest way to go about getting my item.roles model to be an array in the end?
<select class="form-control" ng-model="item.roles" ng-init="item.roles[0]='client'">
<option value="[super, admin, producer, resource, client]">Super</option>
<option value="[admin, producer, resource, client]">Admin</option>
<option value="[producer, resource, client]">Producer</option>
<option value="[resource, client]">Resource</option>
<option value="[client]">Client</option>
</select>
You can use ngList directive:
Note, that option values in this case are comma separated list (or you can change delimiter).
ngList
directive is used to convert delimited list of values to/from array:Demo: http://plnkr.co/edit/TbkEne7ap4WpCS4UPj7U?p=preview