Closed sumeetddubey closed 6 years ago
Hi, I am trying to execute a function and navigate to another page after a wheelnav menu item is clicked. But this doesn't seem to work. My code is below:
wheel.navItems[0].navigateFunction= function(){ $rootScope.$broadcast('myFunction', { data: 'data' }); $location.url('/myPage'); };
I tried logging to console in this function and thats working so the function is executing. Can you help in pointing out whats wrong?
Thanks a lot.
Did you try wheelnav as a scope variable? $scope.wheel
$scope.wheel
No luck with scope
Resolved it! Adding $scope.$apply() at the end of the function did the trick. Thanks :)
Hi, I am trying to execute a function and navigate to another page after a wheelnav menu item is clicked. But this doesn't seem to work. My code is below:
wheel.navItems[0].navigateFunction= function(){ $rootScope.$broadcast('myFunction', { data: 'data' }); $location.url('/myPage'); };
I tried logging to console in this function and thats working so the function is executing. Can you help in pointing out whats wrong?
Thanks a lot.