4.0.0 • Published 9 years ago

@calle/ng2-request-manager v4.0.0

Weekly downloads
1
License
ISC
Repository
github
Last release
9 years ago

ng2-request-manager

Angular 2 REST Request manager

Install

  • npm install --save @calle/{ng2-request-form,ng2-browser-storage,ng2-table,ng2-request-manager}
  • Also need @ngrx/store to work
  • Set up ng2-browser-storage first and add a browser storage param for this app
  • Use in your app.module.ts:
import {
  provideRequestManager,
  RequestManagerModule
} from '@calle/ng2-request-manager'
...
@NgModule({
  ...
  imports: [
    RequestManagerModule
    ...
  ]
  ...
  providers: [
    // NOTE it's the key without the co-browser-storage namespace here
    provideRequestManager('requestManagerConfig')
    ...
  ]
  ...
})
  • co-browser-storage.config:
export const REQUEST_MANAGER_CONFIG = 'requestManagerConfig'
...
{
  key: REQUEST_MANAGER_CONFIG,
  value: '{"requests":[]}',
  storageType: 'localStorage',
  valueType: 'text'
}
...
  • some.component.ts:

Note that listHeight is optional

import {Component, ViewChild} from '@angular/core'

@Component({
  selector: 'app',
  template: `
    <request-manager
      [listHeight]="'300px'">
      <button type="button" class="btn btn-success btn-block" (click)="makeRequest()">
        Make request
      </button>
    </request-manager>
  `
})
export class AppComponent {
  @ViewChild(RequestManagerComponent) requestManagerComponent: RequestManagerComponent

  public makeRequest () {
    let params = this.requestManagerComponent.requestFormComponent.request()
    console.log(params)
  }
}

Develop

  • npm install
  • npm run typings
  • npm run watch
  • npm start
  • Open browser and navigate to localhost:3000
4.0.0

9 years ago

2.2.0

9 years ago

2.1.0

9 years ago

2.0.10

9 years ago

2.0.9

9 years ago

2.0.8

9 years ago

2.0.7

9 years ago

2.0.6

10 years ago

2.0.5

10 years ago

2.0.4

10 years ago

2.0.3

10 years ago

2.0.2

10 years ago

2.0.1

10 years ago

2.0.0

10 years ago

1.2.2

10 years ago

1.2.1

10 years ago