What sets apart the usage of document
from $document
in Angular application development?
I have come across recommendations to opt for Angular's counterparts like:
$window
over window
or $timeout
instead of setTimeout
.
But... why is this advised?
I initially assumed that window
, setTimeout
, and document
would be faster as they are native and do not require traversal through the Angular framework code.
Is it more advantageous to utilize Angular's alternatives rather than JS' native functions and objects?