common
Common utils for Web APIs
Part of Web APIs for Angular
A set of common utils for consuming Web APIs with Angular
Tokens
-
WINDOW
— provides access to globalwindow
object -
NAVIGATOR
— provides access towindow.navigator
object -
NETWORK_INFORMATION
— provides access towindow.navigator.connection
object -
USER_AGENT
— provides access towindow.navigator.userAgent
string -
PERFORMANCE
— provides access towindow.performance
object -
ANIMATION_FRAME
— sharedObservable
based onwindow.requestAnimationFrame
-
CACHES
— provides access towindow.caches
object -
CSS
— provides access towindow.CSS
object or mock object if it's not available (i.e. in IE) -
CRYPTO
— provides access towindow.crypto
object -
LOCATION
— provides access towindow.location
object -
LOCAL_STORAGE
— provides access towindow.localStorage
object -
SESSION_STORAGE
— provides access towindow.sessionStorage
object -
SPEECH_RECOGNITION
— provides access toSpeechRecognition
class or returnsnull
if browser does not support it -
SPEECH_SYNTHESIS
— provides access towindow.speechSynthesis
object -
PAGE_VISIBILITY
— wrapper fordocument.addEventListener('visibilityChange')
api -
HISTORY
— provides access towindow.history
object
How to use
Just inject a token you need. You can also take a look at Stackblitz sample
What advantages do we get from abstract entities in our app?
See also
Other Web APIs for Angular by @ng-web-apis
Core team
Alex Inkin |
Roman Sedov |
评论