-
Notifications
You must be signed in to change notification settings - Fork 27
Typings don't include configure method #130
Comments
@ninachaubal Would you mind adding |
@daffl, thanks for including the import * as io from 'socket.io-client';
import * as feathers from 'feathers-client';
export class MyService {
private feathersService: any;
constructor() {
const socket = io('https://myurl.com');
const feathersApp = feathers().configure(feathers.socketio(socket));
this.feathersService = feathersApp.service('my-item');
}
} using the typings? In my opinion, it should be something like import * as io from 'socket.io-client';
import { FeathersApp, FeathersService, FeathersSocketIO } from 'feathers-client';
export class MyService {
private feathersService: FeathersService;
constructor() {
const socket = io('https://myurl.com');
const feathersSocket = new FeathersSocketIO(socket);
const feathersApp = new FeathersApp(feathersSocket);
this.feathersService = feathersApp.service('my-item');
}
} What do you think? Is that more or less correct? Currently I'm getting errors trying it like that so I think we need some more from the typings. |
@mastertinner the way I've got this to work is to set up feathers globally outside of the Angular app, like the example in the feathers docs. I have the following in my index.html
Then in an Angular service, you can do something like this
I think we might be able to define the |
Thanks, @ninachaubal! Declaring and setting up feathers outside of the Angular app is a workaround which I wouldn't want to do. I think, the way to go is what you suggested. To define the |
I updated to feathers-client 1.8.0 which now includes typings. This broke my build of an Angular 2 app since I couldn't use feathers-client how I used to anymore. I had the following code in the Angular Service (following my own tutorial from https://berndsgn.ch/angular2-and-feathersjs/):
This isn't valid anymore according to the typescript definitions which only export a
FeathersApp
and aFeathersService
. I tried doing the following:but then I wasn't sure where to put the
configure
part because the typings don't know anything like that. Can you help me out here or is that method really missing from the typings?The text was updated successfully, but these errors were encountered: