0

I have working on Edit Profile page in angular Js

Normally List of details will be show. When click on one list , I called the one method

 $scope.editContact = function(user){
            $('#editContactSection').show();
            $scope.eUser = user;
        }

Then I assigned the text box value by eUser

 <input type="text" class="form-control" id="fname"  ng-model="fname" name="fname" ng-minlength='3' value="{{eUser.firstname}}" required>
                            <div ng-show='editContacForm.fname.$error.minlength' class='error'>Enter atleast 3 characters</div>

Here i got the textbox value in input tag in console like value="somename". Value is assigned correctly. But i can't see in textbox in browser window

And how to change the drop down list value. That drop down list value filled by angular js ng-repeat

2 Answers 2

3

Try setting ng-model='eUser.firstname'

as in

<input type="text" class="form-control" id="fname"  ng-model="eUser.firstname" name="fname" ng-minlength='3'  required>
Sign up to request clarification or add additional context in comments.

2 Comments

How to change the drop down based on id or value?
you can set the ng-model for the select tag, refer docs.angularjs.org/api/ng/directive/select
3

Try this

$scope.editContact = function(user){
   $('#editContactSection').show();
   $scope.eUser = user;
   $scope.fname = $scope.eUser.firstname;
}

Or

<input data-ng-init="fname=eUser.firstname" type="text" class="form-control" id="fname"  ng-model="fname" name="fname" ng-minlength='3' required>
                            <div ng-show='editContacForm.fname.$error.minlength' class='error'>Enter atleast 3 characters</div>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.