Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

co-request-manager

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

co-request-manager

Angular 2 - Request manager component

  • 1.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

co-request-manager

Angular 2 REST Request manager

Install
  • npm install --save co-request-form co-browser-storage co-list-view-table co-request-manager
  • Also need @ngrx/store to work
  • Set up co-browser-storage first and add a browser storage param for this app
  • main.ts:
import {provideCoRequestManager} from '../request-manager/co-request-manager.provider'

bootstrap(MyApp, [
  // NOTE it's the key without the co-browser-storage namespace here
  provideCoRequestManager('requestManagerConfigBrowserStorageKey')
])
  • 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'

import {CoRequestManagerComponent} from 'co-request-manager/co-request-manager'

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

  public makeRequest () {
    let params = this.coRequestManagerComponent.coRequestFormComponent.request()
    console.log(params)
  }
}
Develop
  • npm install
  • npm run typings
  • npm run watch
  • npm start
  • Open browser and navigate to localhost:3000

Keywords

FAQs

Package last updated on 11 Aug 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc