What is the best way to close the button on location change.
Currently using ngRoute and the menu-state on the button.
I tried the code:
$rootScope.$on('$locationChangeStart', function(){ $rootScope.closeFab = 'closed'; )}
And the button I'm using is something like:
<span mfb-menu position="br" toggling-method="click" active-icon="mdi mdi-close" resting-icon="mdi mdi-cloud-upload" effect="slidein" menu-state="closeFab">
But it seems like the menu-state is expecting a $scope only and will not work with $rootScope.
If I set it on the $scope on the current controller, it works, just not with $rootScope.
I have a dirty alternative right now with jQuery where I do an attr('data-mfb-state','closed') but it's buggy.
What is the best way to close the button on location change.
Currently using ngRoute and the menu-state on the button.
I tried the code:
$rootScope.$on('$locationChangeStart', function(){ $rootScope.closeFab = 'closed'; )}
And the button I'm using is something like:
<span mfb-menu position="br" toggling-method="click" active-icon="mdi mdi-close" resting-icon="mdi mdi-cloud-upload" effect="slidein" menu-state="closeFab">
But it seems like the
menu-state
is expecting a $scope only and will not work with $rootScope.If I set it on the $scope on the current controller, it works, just not with $rootScope.
I have a dirty alternative right now with jQuery where I do an attr('data-mfb-state','closed') but it's buggy.
Is there anything I'm doing wrong?
Thanks!