0.1.0 • Published 9 years ago
groceries-angular-service v0.1.0
groceries-angular-service
Setup
In order to make the service work you need to add an HttpModule to your @NgModule imports.
For NativeScript use NativeScriptHttpModule
import { NativeScriptHttpModule } from "nativescript-angular/http";@NgModule({
...
imports: [
...
NativeScriptHttpModule
],For Web use HttpModule
import { HttpModule } from '@angular/http';@NgModule({
...
imports: [
...
NativeScriptHttpModule
],Adding to providers
To provide the GroceryListService and UserService services, just import them from groceries-angular-service and add them to the @NgModule providers:
import { GroceryListService, UserService } from 'groceries-angular-service';
@NgModule({
...
providers: [
...
GroceryListService,
UserService
],0.1.0
9 years ago