mean-expert-official / loopback-component-pubsub

DEPRECATED: Use @mean-expert/loopback-component-realtime instead.
https://www.npmjs.com/package/@mean-expert/loopback-component-realtime
11 stars 2 forks source link

Very simple issue #7

Closed cyberbobjr closed 8 years ago

cyberbobjr commented 8 years ago

Hi, thanks you for your great job, i've a little issue with PubSub and Angular2, this is the problem : i have a simple model "Response" with PubSub correctly configured.

With angular2 i coded this simple function inside OnInit of my component : this._responsesservice.onCreate() .subscribe((data)=> { console.log(data) // just for testing });

The loopback server is running, all is fine. When i use loopback /explorer i can post new response and the onCreate method is correctly called.

But when an IOS application POST a response with the POST url, the onCreate inside Angular2 client is never called. BTW the Websocket display correct frame :

42["authenticated",true]

42["[POST]/api/Responses/",{"sondageID":"f42b8ba3d5d5859a03bcbdf69e54cb1e","date":"2016-07-07T20:16:30.000Z","reponses":[{"reponse":["Réponse 2"],"questionType":1,"question_id":0}],"id":"25661c1b27e5ce7684440cd7f9d043f3","sondageCode":"code11"}]

But this trame is never catched by the onCreate method :(

Please can you give me an advice ?

PS : sorry for my bad english it's not my native tongue

FOUND ! : i found my mistake, the URL inside the IOS app was "/api/Responses/" instead of "/api/Responses" .... :)

jonathan-casarrubias commented 8 years ago

Great to see you were able to fix your issue. :)