为什么$state.go不起效


图片描述

代码片段就是这样的,封装一个请求后,在then里面对结果进行处理。会弹出alert但不会跳转页面,用$location.path也不起效果。但是在then外面的$state.go是可以跳转的,请问这是什么情况呢?

ui-router angularjs JavaScript

ccmin 8 years, 12 months ago

第一,看state是否正确注入,第二,go的参数是否正确,第三,把alert去掉试试

人偶·厌夜 answered 8 years, 12 months ago

是不是忘了注入$state

klaifoq answered 8 years, 12 months ago

Your Answer