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
Post a Comment