I'm looking on how to force a controller to refresh from another controller.
for that I'm using a simple test function :
function test() { alert('test'); }
I think using events is the best solution for this issue.
I used the following code :
First controller
.controller('firstcontroller', function($rootScope,$scope, $http,$timeout) {
$scope.$emit('testevent'); })
Second controller
.controller('firstcontroller', function($rootScope,$scope, $http,$timeout) {
$scope.$on('refreshr', function (event) {
alert('test');
}); })
but this is not working ! any advice ?