Adds new function to interface to retrieve all enabled currency data from exchange

Implements on alphapointhttp.go
Adds new page to UI to handle exchange balances
This commit is contained in:
Scott
2016-09-05 21:57:23 +10:00
parent 8d1afb7e4e
commit 244cdcb48c
6 changed files with 111 additions and 5 deletions

View File

@@ -0,0 +1,28 @@
<h2>Dashboard</h2>
<h3>Your current standings</h3>
<div ng-repeat="exchange in exchanges">
<h4>{{exchange.exchangeName}}</h4>
<table class="table table-striped">
<tr>
<th>Currency</th>
<th>Last</th>
<th>High</th>
<th>Low</th>
<th>Volume</th>
<th>Bid</th>
<th>Ask</th>
</tr>
<tr ng-repeat="value in exchange.exchangeValues">
<td>{{value.CryptoCurrency}}</td>
<td>{{value.Last}}</td>
<td>{{value.High}}</td>
<td>{{value.Low}}</td>
<td>{{value.Volume}}</td>
<td>{{value.Bid}}</td>
<td>{{value.Ask}}</td>
</tr>
</table>
<div ng-repeat="value in exchange.exchangeValues">
</div>
</div>

View File

@@ -0,0 +1,29 @@
'use strict';
angular.module('myApp.home', ['ngRoute'])
.config(['$routeProvider', function($routeProvider) {
$routeProvider.when('/', {
templateUrl: '/views/home/home.html',
controller: 'HomeController'
});
}])
.controller('HomeController', function ($scope, $http, Notification) {
$scope.getDashboardData = function() {
$http({
method: 'GET',
url: '/data/all-enabled-currencies'
}).
success(function (data, status, headers, config) {
$scope.exchanges = data.data;
Notification.info("Retrieved latest data");
}).
error(function (data, status, headers, config) {
console.log('error');
});
};
$scope.getDashboardData();
});

View File

@@ -0,0 +1,16 @@
'use strict';
describe('myApp.view1 module', function() {
beforeEach(module('myApp.view1'));
describe('view1 controller', function(){
it('should ....', inject(function($controller) {
//spec body
var view1Ctrl = $controller('View1Ctrl');
expect(view1Ctrl).toBeDefined();
}));
});
});