Home>

When there is a large amount of background request tasks,You can set the time and operation of the synchronization,

Use ng-model-options to improve website performance.

<! Doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <script src="angular.min.js"></script>
</head>
<body>
<div ng-app="module" ng-controller="ctrl">
<!-Updateon:blur, update the scope data synchronously when the mouse leaves->
<!-Debounce:5000, 5 seconds after data input is completed, update scope data synchronously->
  <input type="text" ng-model="title" ng-model-options="{updateon:" default blur ", debounce:{default:2000, blur:0}}">
  <!-Ng-model-options="{updateon:" default blur ", debounce:{default:2000, blur:0}}
  Enter cursor to leave,update immediately,Unless you leave
Update in 2 seconds
->
  {{title}}
</div>
<script>
  var m=angular.module ("module", []);
  m.controller ("ctrl", ["$scope", function ($scope) {
  }]);
</script>
</body>
</html>
  • Previous iview Upload component sample code for multiple file uploads
  • Next AngularJs use ng-repeat to select a method after traversing
  • Trends