I am developing an ionic mobile application and I need to pass parameters to the $timeout promise so I can make some operations with that parameters. I read the angularjs doc about $timeout (https://docs.angularjs.org/api/ng/service/$timeout) and it says that the last parameter can be parameters passed to the timeout function. I tried this:
$timeout(function(params){
alert(params.p1 + " - " + params.p2);
}, 5000, true, {p1 : "Hello", p2 : "World"});
but it is not working, I can't have acces to the params variable inside the timeout function.
Am I doing something wrong? or, is there another way to do this?
Thanks