user interface - How to check or get the success of $state.go() in angularjs -


we have 1 requirement in $state.go() opens html page dynamic table. once $state.go creates/loads <table> tag have set values in cells of table. $state.go uses promise in back-end. when method calling $state.go called doesn't set values first time. start next time.

the scenario is:

$scope.myfunction:function() {   $state.go('xyz');   setvalues() //should called once previous line completed } 

i have tried:

$rootscope.$on $statechangesuccess event //it not triggered , there no value inside tostate $state.go().then //which makes code execute second time. 

and lot more things.

please me out.

ui-router state.go() return promise, like:

$scope.myfunction:function() {   $state.go('xyz')      .then(function(){        setvalues(); //will executed after $state.go() succeeds      }); } 

Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -