Advertisement
Guest User

Untitled

a guest
Mar 28th, 2015
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. .controller('userCreateController', function(User,Profile,Auth) {
  2. alert("hello");
  3. var vm = this;
  4. vm.type = 'create';
  5. Profile.all() //this service fetch all profiles to be shown in select field
  6. .success(function(data){
  7. vm.profile = data;
  8.  
  9. });
  10. vm.userData.profile = vm.profile[0]; //here i have set default value for select field
  11.  
  12. <label class="col-sm-2 control-label">Profile</label>
  13. <div class="col-sm-8">
  14.  
  15. <select ng-model="user.userData.profile" ng-options="person._id as person.profileName for person in user.profile">
  16. </select>
  17.  
  18. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement