I am new to angular and try to work with data that server sends periodically.
I have one main html page and set a main angular js file. In the main page, I am navigating sub html pages through ngRoute from man html page. This is my main.js.
var serviceMod = angular.module("service", ['ngRoute']);
serviceMod.config(['$routeProvider',
function($routeProvider) {
$routeProvider.
when('/sell', {
templateUrl: 'sellstats.html',
controller: 'sellstats'
}).
when('/cache-service', {
templateUrl: 'buy.html',
controller: 'buyingstats'
}).
otherwise({
redirectTo: '/home.html'
});
}]);
my main.js connects to a server in web sockets.
var socket = new SockJS(URL);
stompClient = Stomp.over(socket);
And it takes responses every 10 seconds.
I want to send these results into those sub html pages through angular and the sub angular functions in sub html files should be able to have those updated last received responses through websockets.(I use angular 1.2)
Please let me know
1.How I can bound dynamic data which received through websockets ?
2. How the sub angular js functions in sub html pages will access updated values ?