angularjs - Binding model from controller -


how can binding model controller ?

here code

angular.module('elnapp')  .controller('gridctrl', function ($scope, $http, $routeparams, $location,    programservice) { $scope.gridoptions = {     data: 'mydata',     enablepaging: true,     showfooter: true,     totalserveritems:'totalserveritems',     pagingoptions: $scope.pagingoptions,     filteroptions: $scope.filteroptions,     selecteditems: $scope.myselections,     multiselect: false,     afterselectionchange: function (data) {       $scope.program = $scope.myselections[0];       $scope.program = $scope.myselections[0].programid;       programservice.get({              id: $scope.program           }, function (result) {             data = {               'program': result             };           });       $location.path('/program/edit/'+$scope.program);      } };}); 

edit html

<form ng-submit="save()">   <input type="hidden" ng-model="program.program.programid"/>    <dl>     <dt>program name</dt>       <dd><input name="programname" type="text" ng-model="program.program.programname"/></dd>     <dt>program content</dt>   </dl>   <div class="form-actions">     <button type="submit">save</button>  </div> 

when select item after switch page edit html ,i can't bind model?

i confused , please help

<div>programname: {{program.program.programname}}</div> 

Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -