@ramonornela/url-resolver
v0.0.24
Published
Configuration routes to object Http of the Angular2
Downloads
13
Maintainers
Readme
UrlResolverModule
This allow define configuration of objects request
Using HttpModule in an Ionic 2 app
import { NgModule } from '@angular/core';
import { IonicApp, IonicModule } from 'ionic-angular';
import { MyApp } from './app.component';
// import url-resolver module
import { UrlResolverModule } from '@ramonornela/url-resolver';
export const APP_ROUTE = {
'_defaults': {
'host': 'http://api.example.com/'
},
'user': {
'url': 'user/{id}',
'method': 'GET',
'headers': {
'content-type': 'application/json'
},
'params': {
'id': {
'type': 'number',
'required': true
}
}
}
};
@NgModule({
declarations: [
MyApp
],
imports: [
IonicModule.forRoot(MyApp),
UrlResolverModule.initialize(APP_ROUTE),
],
bootstrap: [IonicApp],
entryComponents: [
MyApp
]
})
export class AppModule {}
Contributing
See CONTRIBUTING.md