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

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

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

android - How to create dynamically Fragment pager adapter -