ng-model no longer updates after typing into text input

Deadly 提交于 2019-11-28 18:39:07

your link requires a login.

if i have to guess about your problem, it may be related to angular scoping issue. try changing your ng-model binding to an object property instead. so in your html, instead of:

<input type="text" id="form_course_name" ng-model="edit_course_name">

do this

<input type="text" id="form_course_name" ng-model="course.edit_course_name">

and in your javascript, on the ajax callback, change it to:

$scope.course = {};  //only do this if $scope.course has not already been declared
$scope.course.edit_course_name = thecourse.course_name;

for more info on this issue, see: https://github.com/angular/angular.js/wiki/Understanding-Scopes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!