Update content
This commit is contained in:
parent
1bc63d769d
commit
7ca56b6ccf
5 changed files with 27 additions and 15 deletions
|
|
@ -5,6 +5,21 @@ angular.module('copayApp.controllers').controller('buyandsellController', functi
|
|||
$scope.$on("$ionicView.beforeEnter", function(event, data) {
|
||||
$scope.services = buyAndSellService.get();
|
||||
|
||||
$scope.$on("$ionicView.enter", function(event, data) {
|
||||
console.log("Enter buy page");
|
||||
var r = new XMLHttpRequest();
|
||||
r.open("GET", "https://www.bitcoin.com/api/rv/promoted-exchange", true);
|
||||
r.onreadystatechange = function () {
|
||||
if (r.readyState != 4 || r.status != 200) return;
|
||||
console.log(r.responseText);
|
||||
var adResponse = JSON.parse(r.responseText)
|
||||
document.getElementById("exchange-logo").setAttribute('src', "https://www.bitcoin.com" + adResponse.image)
|
||||
document.getElementById("exchange-name").textContent = adResponse.bannerName;
|
||||
document.getElementById("exchange-text").textContent = adResponse.description;
|
||||
};
|
||||
r.send("defaultpromotion=360");
|
||||
});
|
||||
|
||||
if (lodash.isEmpty($scope.services))
|
||||
$ionicHistory.goBack();
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue