I am trying to implement a function within the controller which will be incharge of showing various notification to the user.
the problem is that I want the duration to be a function parameter, and that doesn't seem to work.
How come?.
How can I fix this?.
$scope.layout.showNotification = function(msg, duration){
$scope.layout.notification.message = msg;
$scope.layout.notification.visible = true;
if(!duration || duration === null)
return
$timeout(function(){
$scope.layout.notification.visible = false;
$scope.layout.notification.message = "";
}, duration);
}