Top "Angular2-services" questions

Use this tag for questions related to Angular 2 Services, which are JavaScript functions responsible for performing a single task.

Angular 2 TypeScript how to find element in Array

I have a Component and a Service: Component: Service: @Injectable() export class PersonService { getPersons(){ var persons: Person[] = [ {id: 1, firstName:'Hans', …

angular typescript angular2-services
What is the proper use of an EventEmitter?

I've read questions like Access EventEmitter Service inside of CustomHttp where the user uses EventEmitter in his service, but he …

angular angular2-services
Angular2: How to load data before rendering the component?

I am trying to load an event from my API before the component gets rendered. Currently I am using my …

typescript angular angular2-services angular2-http
How do I create a singleton service in Angular 2?

I've read that injecting when bootstrapping should have all children share the same instance, but my main and header components (…

angular typescript angular2-routing angular2-services
Getting Image from API in Angular 4/5+?

I have new to develop Angular 4. I have facing issue while getting response from API about display image.In API,…

angular typescript angular2-services
What is the correct way to share the result of an Angular Http network call in RxJs 5?

By using Http, we call a method that does a network call and returns an http observable: getCustomer() { return this.…

angular rxjs angular2-services rxjs5
How I add Headers to http.get or http.post in Typescript and angular 2?

getHeroes (): Observable<Heros[]> { return this.http.get(this.heroesUrl) .map(this.extractData) .catch(this.handleError); } Where I add …

angular2-services
How to check the length of an Observable array

In my Angular 2 component I have an Observable array list$: Observable<any[]>; In my Template I have <…

angular observable angular2-template angular2-services
Property 'subscribe' does not exist on type '() => Observable<any>'

service file import { Observable } from 'rxjs/Rx'; import { Http,Response} from '@angular/http'; import { Injectable } from '@angular/core'; …

angular typescript rxjs observable angular2-services
How to bind static variable of component in HTML in angular 2?

I want to use a static variable of a component in HTML page. How to bind static variable of component …

angular typescript angular2-services