Thursday 16 November 2017
typescript - Observable in angular 2 ?
Answer
I searched and explored regarding my question
but I didn't get the appropriate answer, I am new in angular 2, exploring and creating a
demo app with the help of angular's official doc. ( href="https://angular.io/docs/ts/latest/tutorial/toh-pt6.html" rel="nofollow
noreferrer">https://angular.io/docs/ts/latest/tutorial/toh-pt6.html ). Now
I reached HTTP section. Here I am not able to understand what is observable and why it
is used?
Can anyone please let me
know why Observable used in below
code?
search(term: string):
Observable {
return this.http
.get(`app/heroes/?name=${term}`)
.map(response => response.json().data as
Hero[]);
}
why here also
?:
import { Hero } from
'./hero';
export class HeroSearchComponent implements OnInit
{
heroes:
Observable;
}
I
am still confused for promise and observable . What is the difference between promise
and observable ? And why they chose Observable ?
php - file_get_contents shows unexpected output while reading a file
I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...
-
I have an app which needs a login and a registration with SQLite. I have the database and a user can login and register. But i would like th...
-
I got an error in my Java program. I think this happens because of the constructor is not intialized properly. My Base class Program public ...
-
I would like to use enhanced REP MOVSB (ERMSB) to get a high bandwidth for a custom memcpy . ERMSB was introduced with the Ivy Bridge micro...
No comments:
Post a Comment