AngularJS is not updating a select after an option was deleted -


Not updating the options of a selection box after the corner is removed. I have to refresh the view to see the updated options. Thank you

My view

form (ng-controller = "formumvustadent controller", name = "formadministrationform", enlidet) div.combine label.default.top (for = "Student") Select a student. Default (ng-model = "student.id", ng-option = "s.id as s.name for students in s") option (value = "") I would like to remove ... div. Submit Controller

My Controller

  App Controller ('FormRemoveStudentController', [ '$ Scope', '$ http', function ($ amount, $ http) {$ scope.student = {}; $ scope.students = []; var setStudents = function (data) {$ Scope.students = data. Students || []; console.log ("Students updated.")} Error students = function () {$ scope.students = []; console.error ("database Reverse ");} $ Http.get (url) .sevate (set students) .Rar (error); $ scope.removeStudent = function () {var FinalURL = url + $ scope.student.id; // $ http .delete (last); This is supposed to work if the server was okay. Delete the option $ scope.student = {}; Http.get (URL) .success (setStudents). Error (errorStudents); // Reload options}; }]  

NG model to student on your selection Instead of a blank object, place it in an empty space


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -