src/app/providers/hero.service.ts
Properties |
|
Methods |
|
constructor(http: HttpClient, messageService: MessageService)
|
|||||||||
Defined in src/app/providers/hero.service.ts:17
|
|||||||||
Parameters :
|
addHero | ||||||
addHero(hero: Hero)
|
||||||
Defined in src/app/providers/hero.service.ts:70
|
||||||
POST: add a new hero to the server
Parameters :
Returns :
Observable<Hero>
|
deleteHero | ||||||
deleteHero(hero: Hero | number)
|
||||||
Defined in src/app/providers/hero.service.ts:78
|
||||||
DELETE: delete the hero from the server
Parameters :
Returns :
Observable<Hero>
|
getHero | ||||||
getHero(id: number)
|
||||||
Defined in src/app/providers/hero.service.ts:47
|
||||||
GET hero by id. Will 404 if id not found
Parameters :
Returns :
Observable<Hero>
|
getHeroes |
getHeroes()
|
Defined in src/app/providers/hero.service.ts:24
|
GET heroes from the server
Returns :
Observable<Hero[]>
|
getHeroNo404 | ||||||
getHeroNo404(id: number)
|
||||||
Defined in src/app/providers/hero.service.ts:33
|
||||||
Type parameters :
|
||||||
GET hero by id. Return
Parameters :
Returns :
Observable<Hero>
|
Private handleError | |||||||||||||||
handleError(operation: string, result?: T)
|
|||||||||||||||
Defined in src/app/providers/hero.service.ts:102
|
|||||||||||||||
Type parameters :
|
|||||||||||||||
Handle Http operation that failed. Let the app continue.
Parameters :
Returns :
(error: any) => any
|
Private log | ||||||
log(message: string)
|
||||||
Defined in src/app/providers/hero.service.ts:117
|
||||||
Log a HeroService message with the MessageService
Parameters :
Returns :
void
|
searchHeroes | ||||||
searchHeroes(term: string)
|
||||||
Defined in src/app/providers/hero.service.ts:56
|
||||||
Parameters :
Returns :
Observable<Hero[]>
|
updateHero | ||||||
updateHero(hero: Hero)
|
||||||
Defined in src/app/providers/hero.service.ts:89
|
||||||
PUT: update the hero on the server
Parameters :
Returns :
Observable<any>
|
Private heroesUrl |
heroesUrl:
|
Type : string
|
Default value : 'api/heroes'
|
Defined in src/app/providers/hero.service.ts:17
|