ngx-sails
A socket client for Angular (2+) applications that connect to a Sails socket.io API.
Installation
npm install ngx-sails
Usage
Add SailsClientModule
to your application module.
// Optional, the URI will default to origin;
Inject the SailsClient
into your component.
API
Methods
- get(url:
string
, options:ISailsRequestOpts
):Observable<SailsResponse>
- post(url:
string
, body:any
, options:ISailsRequestOpts
):Observable<SailsResponse>
- put(url:
string
, body:any
, options:ISailsRequestOpts
):Observable<SailsResponse>
- patch(url:
string
, body:any
, options:ISailsRequestOpts
):Observable<SailsResponse>
- delete(url:
string
, options:ISailsRequestOpts
):Observable<SailsResponse>
- head(url:
string
, options:ISailsRequestOpts
):Observable<SailsResponse>
- options(url:
string
, options:ISailsRequestOpts
):Observable<SailsResponse>
- on(event:
string
):Observable<any>
Properties
- requestErrors:
Observable<SailsError>