mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-02 07:26:53 +00:00
28 lines
706 B
JavaScript
28 lines
706 B
JavaScript
'use strict';
|
|
|
|
angular.module('myApp.home', ['ngRoute'])
|
|
|
|
.config(['$routeProvider', function($routeProvider) {
|
|
$routeProvider.when('/', {
|
|
templateUrl: '/views/home/home.html',
|
|
controller: 'HomeController'
|
|
});
|
|
}])
|
|
|
|
.controller('HomeController', function($scope, $rootScope, $timeout, webSocket) {
|
|
$scope.loaded = false;
|
|
|
|
$rootScope.$on('CurrencyChanged', function(event, args) {
|
|
$scope.currency = args.Currency;
|
|
$scope.exchange = args.Exchange;
|
|
$scope.loaded = true;
|
|
});
|
|
|
|
$timeout(function() {
|
|
if ($scope.currency) {
|
|
$scope.loaded = true;
|
|
} else {
|
|
$scope.loadFailed = true;
|
|
}
|
|
}, 10000);
|
|
}); |