https://github.com/normandy72/digest-and-apply
$digest and $apply functions in AngularJS. Coursera course "Single Page Web Applications with AngularJS" by Yaakov Chaikin.
https://github.com/normandy72/digest-and-apply
angular angularjs html html5 javascript js
Last synced: about 1 month ago
JSON representation
$digest and $apply functions in AngularJS. Coursera course "Single Page Web Applications with AngularJS" by Yaakov Chaikin.
- Host: GitHub
- URL: https://github.com/normandy72/digest-and-apply
- Owner: Normandy72
- Created: 2023-01-05T19:31:00.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T20:06:34.000Z (over 3 years ago)
- Last Synced: 2025-01-14T12:46:39.351Z (over 1 year ago)
- Topics: angular, angularjs, html, html5, javascript, js
- Language: JavaScript
- Homepage:
- Size: 65.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
* setTimeout function lives separate from digest, so digest can be installed manually: `$scope.$digest();`. But that is a __wrong way__, because exceptions and errors in this code (code before `$scope.$digest();`) become invisible for Angular.
* __correct way__ is using `$apply` instead of `$digest`.
* `$apply` accept function where our code can be moved to.
* in native Angular there is a `$timeout` function and there is no reason to use `setTimeout()`, `$digest` or `$apply`.