Last Updated: February 25, 2016
·
640
· xiujunma

AngularJs and Atmosphere

var QuotesController = function ($scope, $rootScope) {
    $scope.quotes = finance.cache.quotes;
    listeners.quote.push(function (quote) {
        $scope.$apply(function () {
            $scope.quotes[quote.productId] = quote;
        });

        $rootScope.$broadcast('quote', quote);
    });
};