groceries-angular-service
Angular Service to be used with the sample groceries project
npm i --save groceries-angular-service
- Version: 0.1.0
- GitHub:
- NPM: https://www.npmjs.com/package/groceries-angular-service
- Downloads:
- Last Day: 0
- Last Week: 0
- Last Month: 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
],