1.5.1 • Published 8 years ago
angular-base-service v1.5.1
angular-base-service
Installation
To install this library, run:
$ npm install angular-base-service --saveConsuming your library
Once you have published your library to npm, you can import the library AppModule:
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
// Import your library
import { NgBaseServiceModule } from 'angular-base-service';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
// Specify your library as an import
NgBaseServiceModule.forRoot({
// will be prepended to all http calls, defaults to ''
baseServiceUrl: 'https://baseUrl.com',
// will be sent with all http calls headers as `token:mySecretKey`,
// unless specified in the `request` object, which takes precedence
baseServiceKey: 'mySecretKey',
})
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }Once your library is imported, refer to the base-test.service.ts file
for an example of how to use it, and test it
Development
To generate all *.js, *.d.ts and *.metadata.json files:
$ npm run buildTo lint all *.ts files:
$ npm run lintLicense
MIT © Mark Massoud