added lots of shapeshift related code
This commit is contained in:
parent
2f07290dea
commit
c4c8008573
12 changed files with 669 additions and 0 deletions
37
src/js/directives/shapeshiftCoinSelector.js
Normal file
37
src/js/directives/shapeshiftCoinSelector.js
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.directives').directive('shapeshiftCoinSelector', function(shapeshiftApiService) {
|
||||
return {
|
||||
require:['^shapeshiftCoinTrader'],
|
||||
restrict: 'E',
|
||||
transclude: false,
|
||||
scope: {
|
||||
coins: '=coins',
|
||||
label:'=label',
|
||||
selectedCoin:'=selectedCoin',
|
||||
getMarketData: '=getMarketData',
|
||||
amount:'=amount',
|
||||
marketData:'=marketData',
|
||||
coinAddress:'=coinAddress',
|
||||
direction:'=direction',
|
||||
},
|
||||
link: function(scope, element, attrs, controllers) {
|
||||
var coinTraderCtrl = controllers[0];
|
||||
|
||||
scope.selectedCoinModel = {
|
||||
coin: scope.selectedCoin
|
||||
}
|
||||
|
||||
scope.$watch('coinAddress', function(newVal){
|
||||
if(scope.direction === 'in')
|
||||
coinTraderCtrl.returnAddress(newVal);
|
||||
else if(scope.direction === 'out')
|
||||
coinTraderCtrl.withdrawalAddress(newVal);
|
||||
});
|
||||
scope.$watch('amount', function(newVal){
|
||||
coinTraderCtrl.amount(newVal)
|
||||
});
|
||||
},
|
||||
templateUrl: 'views/includes/shapeshift-coin-selector.html'
|
||||
}
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue