Angular Service - Tuong-Nguyen/Angular-D3-Cometd GitHub Wiki
Angular Service
Classes that you can inject in an other.
Provided Services:
Title Service
Allow changing Title of the page
class PonyRacerAppComponent {
constructor(title: Title) {
title.setTitle('PonyRacer - Bet on ponies');
}
}
Meta service
Allow getting or updating the "meta" values of the page
class PonyRacerAppComponent {
constructor(meta: Meta) {
meta.addTag({ name: 'author', content: 'Ninja Squad' });
}
}
Custom service
@Injectable()
export class RacesServiceWithHttp {
constructor(private http: HttpClient) {
}
list() {
return this.http.get('/api/races');
}
}