loopback-example-angular-live-set icon indicating copy to clipboard operation
loopback-example-angular-live-set copied to clipboard

What does the lbService `createchangestream` do, and how do you use it?

Open njcaruso opened this issue 11 years ago • 1 comments

In my angular app I am successfully using the sample code:

var src = new EventSource('/api/sources/change-stream?_format=event-source&access_token=123');
var changes = createChangeStream(src);
var set;

my loopback API is protected through authentication, and requires an access_token, so I'm appending the token as needed. It's not too hard to build the above url string to include the access_token, but I was wondering perhaps lbServices could help. Why in your angular-live-set example code do you not use loopback's built in Angular $resource generated via lb-ng, which seems to have a change-stream API support, example documentation here for createchangestream

I'm guessing I can use the lbServices $resource somehow. Can you please provide sample code on how to use it?

njcaruso avatar Sep 15 '15 03:09 njcaruso

Please post questions at https://groups.google.com/forum/#!forum/loopbackjs. See https://github.com/strongloop/loopback/wiki/Questions for more details.

0candy avatar Nov 18 '15 18:11 0candy