angular.js - angular local dom refresh problem
某草草
某草草 2017-05-15 16:52:55
0
1
773

dom

<input type="text" value="{{ val}}"/> <textarea ng-bind="msg"></textarea>

Operation

  1. Click to open the pop-up layer, enter the data -> Confirm -> scope to save the data, close the pop-up layer
  2. Click to open the pop-up layer, enter the data - "Cancel -" scope does not save the data, close the pop-up layer

Question

When performing the second operation, the scope did not save the entered text. When the popup layer was opened again, the entered text was still retained. I want to execute $scope.$apply() to refresh when I click to open, but it fails with an error. . So, how to refresh scope->view?

某草草
某草草

reply all(1)
曾经蜡笔没有小新

I don’t understand what you mean, but if you want to reset the input box in the pop-up layer when it is closed or opened, wouldn’t it be enough to just clear the corresponding object or attribute in the scope?

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template