Learning Angular - Second Edition by Christoffer Noring

Learning Angular - Second Edition by Christoffer Noring

Author:Christoffer Noring
Language: eng
Format: epub, mobi
Publisher: Packt
Published: 2017-12-06T09:36:50+00:00


What you can see from the preceding timeline of keyUps is that it is a continuous stream of data where the keyUp event can happen at any time; after all, the user decides when to press those keys. Remember the Observable code we wrote, containing the setTimeout? That code was able to tell a concept Observer that every time 2 seconds passed, another value should be emitted. What's the difference between that code and our keyUps? Nothing. Well, we know how often a timer interval is triggered, and with keyUps, we don't really know because it is not in our hands. But that is really the only difference, which means keyUps can be thought of as an Observable as well:

let key = document.getElementId('.search');

/*

we assume there exist a button in the DOM like this

<input class="search" placeholder="searchfor"></input>

*/



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.