I have a filter, that should use some variables from the controller. But when I run the application, there is an error in my console: Error: Can't find variable: $scope...
Here is my filter:
calcM.filter('money', function () {
return function (premium) {
if (isNaN(premium) || premium < 1) {
return premium;
} else {
if ($scope.data.pickedOptions.currency == $scope.currency.USD) {
return premium + 'USD'
} else if ($scope.data.pickedOptions.currency == $scope.currency.EUR) {
return premium + 'EUR'
}
}
}
});
And then goes my controller:
calcM.controller('calcMCtrl', function($scope, $http, $window) {...});
If I include this filter in the controller I have another injection error.