loopback-example-angular-live-set
loopback-example-angular-live-set copied to clipboard
Is it working on Ionic? Mine is not
Is this live-set module working on ionic? because mine is not working. and i don't get any error.
here is my code:
on Main App
angular.module('starter', ['ionic', 'starter.controllers', 'lbServices', 'ls.LiveSet', 'ls.ChangeStream'])
//etc............
on Controller
angular.module('starter.controllers', [])
.controller('ProductsCtrl', function($scope, $ionicModal, Product, createChangeStream, LiveSet) {
var src = new EventSource('http://localhost:3000/api/products/change-stream?_format=event-source');
var changes = createChangeStream(src);
var set;
Product.find().$promise.then(function(results) {
set = new LiveSet(results, changes);
$scope.products = set.toLiveArray();
});
changes.on('data', function(update) {
// add the new data to the chart
console.log('something happened')
console.log(update)
});
//etc.................
My data is shown like expected, but the realtime thing is not working. (console not printing anything) Please help
Can you provide a link to a test project? See https://github.com/strongloop/loopback/wiki/Reporting-issues#bug-report.
Closing this as a dup of this: https://github.com/strongloop/angular-live-set/issues/12