feathersjs-ecosystem / client

[MOVED] Client side Feathers build
https://github.com/feathersjs/feathers
MIT License
111 stars 27 forks source link

implementation of feathers client in angular-2 #135

Closed vanishree1 closed 7 years ago

vanishree1 commented 7 years ago

I'm trying to implement feathers-client in angular-2 with the help of feathers doc.

1)export class SocketService extends Service, not sure where this Service is from.

2)this._rest = _restService.getService('messages'); this._socket = _socketService.getService('messages');

getService is not implement in feathers.service.ts

P.S : Kindly demonstrate with complete functional todo app using feathers-client in angular2.

superbarne commented 7 years ago

my current api service for feathers is:

import { Injectable } from '@angular/core';
import * as io from "socket.io-client";
import * as feathers from 'feathers/client';
import * as socketio  from 'feathers-socketio/client';
import * as hooks  from 'feathers-hooks';
import * as authentication  from 'feathers-authentication/client';

declare const window;

@Injectable()
export class ApiService {
  public socket: io.socket;
  public app: any;

  private url: string = "http://127.0.0.1:3000";

  constructor() {
    this.socket = io(this.url);

    this.app = feathers()
      .configure(socketio(this.socket))
      .configure(hooks())
      .configure(authentication({ storage: window.localstorage}));
  }
}
daffl commented 7 years ago

There is now a sample Angular chat implementation at https://github.com/j2L4e/feathers-chat-angular