AngularJS / ui-router: $state.go does not work inside ng-click

后端 未结 3 1678
星月不相逢
星月不相逢 2020-12-31 05:33

I have a view where I have the following code:


T

3条回答
  •  长情又很酷
    2020-12-31 06:09

    Simplest Solution is to use $Window Service and old Approach

    1. Inject $window service of angular JS.
    2. Use history.back() function of javascript.
    3. Done,It is simplest solution if you just want to go back.

    I will not write whole angular JS. Only code that matters:

    HTML-Code

    
    

    JS-Code

    self.goBack = function(){ $window.history.back(); };

提交回复
热议问题