Skip to content

Instantly share code, notes, and snippets.

@kenrick
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kenrick/9883597 to your computer and use it in GitHub Desktop.
Save kenrick/9883597 to your computer and use it in GitHub Desktop.
angular.module("testApp", [])
.controller("testController", function ($scope) {
$scope.base = 1;
$scope.currency = "USD";
$scope.multiplyByBase = function(amount) {
var base = parseFloat($scope.base) ? $scope.base : 1;
return amount * base;
}
$scope.changeCurrency = function(currency) {
$scope.currency = currency;
$scope.traders = traders[currency];
}
$scope.traders = traders[$scope.currency];
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment