Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .controller('userCreateController', function(User,Profile,Auth) {
- alert("hello");
- var vm = this;
- vm.type = 'create';
- Profile.all() //this service fetch all profiles to be shown in select field
- .success(function(data){
- vm.profile = data;
- });
- vm.userData.profile = vm.profile[0]; //here i have set default value for select field
- <label class="col-sm-2 control-label">Profile</label>
- <div class="col-sm-8">
- <select ng-model="user.userData.profile" ng-options="person._id as person.profileName for person in user.profile">
- </select>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement