here's deal:
trying create global alert message notify user he's done action (for example, logged-out).
i using sb admin 2.0 startangular.com.
how looks when make proper action.

now, question actually, how do, message last state?
if go let's '/login' state here took picture (dashboard), message disappear.
i add jsfiddle link.
it's not supposed show correct result, rather give code have currently.
the core me using factory hold data want save between different states.
after fill factory data want insert in message, give signal boolean.
then, @ beginning of controller* seek signal, , if on, use state change events remove log-out signal in next state**.
$scope.userutil = userutil; if ('loggedout' in $scope.userutil){ $rootscope.$on('$statechangesuccess', function(event, tostate, toparams, fromstate, fromparams){ console.log(1); delete $scope.userutil.loggedout; }) } do think going in right direction? there way see can in more simple way?
i appreciate opinion.
*the controller bound abstract state called main (which includes header, , sidebar)
**the method using not perfect, seems function bind event not 1 timer. if log out once, won't see message again since every state enter successfully, log-out signal deleted no matter what.
never mind, this package need.
Comments
Post a Comment