Skip to content

Instantly share code, notes, and snippets.

@sejr
Created April 23, 2016 05:40
Show Gist options
  • Select an option

  • Save sejr/e39c11ba2e395a2ec1088628fa3803f3 to your computer and use it in GitHub Desktop.

Select an option

Save sejr/e39c11ba2e395a2ec1088628fa3803f3 to your computer and use it in GitHub Desktop.
$scope.weighItem = function() {
return $http({
method: 'GET',
url: 'https://jsonp.afeld.me/?url=http://smartshop-sjroot.rhcloud.com/api/readings'
});
}
$scope.updateReading = function() {
$scope.weighItem().then(function success(res) {
console.log(res);
$scope.newItem.value = res.data.value;
$scope.newItem.unit = res.data.unit;
}, function error(res){
console.log(res);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment