Guest User

Untitled

a guest
Jun 22nd, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.5/angular.js"></script>
  5. <script>
  6. angular.module('App', []).controller('world', function ($scope) {
  7. $scope.value = 0;
  8. $scope.send = function() {
  9. alert($scope.value);
  10. }
  11.  
  12. let readback = function() {
  13. $scope.value += 1;
  14. $scope.$apply();
  15. setTimeout(readback, 100);
  16. };
  17. setTimeout(readback, 1);
  18. });
  19. </script>
  20. </head>
  21.  
  22. <body ng-app="App" ng-controller="world">
  23. <input type="text" ng-model="value" ng-keyup="$event.keyCode == 13 && send()" />
  24. </body>
Add Comment
Please, Sign In to add comment