简体   繁体   中英

How to pass values from server to angular

Here i'm using Angular with mvc During edit mode how to pass values

  <input type="button" class="btn btn-sm btn-success" value="Edit" ng-click="EditUser(ee)"  />

When i click on edit button model is popup but why values not binding in textbox

 <input type="text" name="name" class="form-control" ng-model="User.Name" />
 <input type="text" name="name" class="form-control" ng-model="User.Eamil" />

if i change User.Name to Name then its wirking Fine

 $scope.EditUser = function (ee) {
                  var serdata = Generalsrvs.EditService(ee.User.UserId);
                    serdata.then(function () {

                        $scope.User.UserId = ee.User.UserId,
                        $scope.User.Name  = ee.Name,
                        $scope.User.Eamil = ee.Eamil

                       $('#modalpop').modal('show');

                    })

Considering that you just want to pass values.,

According to the AngularJS:API , you can simply do this:

<div ng-init="myModule=value-here">
   //something
</div>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM