Top "Angular2-services" questions

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

Subscribe to observable is returning undefined

So I am trying to subscribe to a simple service that return data from a local JSON file. I have …

javascript angular typescript observable angular2-services
Angular2 - Share data between components using services

I have an object that I want to share between my components into an Angular2 app. Here is the source …

typescript angular angular2-services
Angular2 global service provider

/app - app.component.ts - app.component.html (hide/show: menu bar) - app.global.service.ts (Public varible …

angular angular2-services
How to avoid imports with very long relative paths in Angular 2?

How can I introduce something like 'my-app-name/services' to avoid lines like the following import? import {XyService} from '../../../services/…

typescript ecmascript-6 angular angular2-services
Download a file from asset folder when clicking on a button

I am working on an angular2 project, I have a file in assets folder and I have created a button …

angular angular2-services angular-http
Angular 2 HTTP "Cannot resolve all parameters for 'AppService'"

I tried to import the http provider into a service, but I'm getting the following error: Cannot resolve all parameters …

typescript angular systemjs angular2-services angular2-injection
Property 'then' does not exist on type Observable

I'm new to angular 2 and I'm trying to make a REST GET request, but I'm getting this error when trying: …

angular angular2-services
how to extend service with dependencies in angular 2

I have a parent service which has some dependencies like @Injectable() export class ParentService{ constructor(private http:Http, private customService:…

angular typescript extends angular2-services
Angular 2 - Using Shared Service

Looks like shared services is the best practice to solve many situations such as communication among components or as replacement …

angular angular2-services
Best practice for handling error in Angular2

Hi i am trying to receive error sent from catch block (service). in multiple components i need to show a …

angular angular2-services