angular.module('myapp.controllers', ['myapp.services']) .controller('SampleController', function($scope, SampleService) { $scope.qty = 1; $scope.cost = 2; $scope.inCurr = 'JPY'; $scope.currencies = SampleService.currencies; $scope.total = function (outCurr) { return SampleService.convert($scope.qty * $scope.cost, $scope.inCurr, outCurr); }; $scope.pay = function () { SampleService.pay($scope.qty,