Skip to content

Commit

Permalink
add address to tokencontroller
Browse files Browse the repository at this point in the history
  • Loading branch information
elaineo committed Mar 20, 2017
1 parent 257c07e commit 6ad0fa4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions public/js/controllers/TokenController.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,18 @@ angular.module('BlocksApp').controller('TokenController', function($stateParams,
$scope.activeTab = activeTab[1];

$rootScope.$state.current.data["pageSubTitle"] = $stateParams.hash; //replace with token name
$scope.token = {"balance": 0, "extra_balance": 0, "address": $stateParams.hash};
var address = isAddress($stateParams.hash) ? $stateParams.hash : undefined;
$scope.token = {"balance": 0};

//fetch dao stuff
$http({
method: 'POST',
url: '/tokenrelay',
data: {"action": "info"}
data: {"action": "info", "address": address}
}).success(function(data) {
console.log(data)
$scope.token = data;
$scope.token.address = address;
});

$scope.form = {};
Expand All @@ -34,7 +37,7 @@ angular.module('BlocksApp').controller('TokenController', function($stateParams,
$http({
method: 'POST',
url: '/tokenrelay',
data: {"action": "balanceOf", "addr": addr}
data: {"action": "balanceOf", "user": addr, "address": address}
}).success(function(data) {
console.log(data)
$scope.showTokens = true;
Expand Down

0 comments on commit 6ad0fa4

Please sign in to comment.