Search code examples
javascriptangularjsanchorangularjs-ng-href

ng-href="#/myanchor" not working anymore as usual with angularjs 1.6.1


I used to work with angularjs 1.5.8. For professional reasons I need to migrate to version 1.6.1 and I need to use ng-href to go to an anchor that I configured.

So when I write in my code:

<a ng-href="#/rubric/{{ data }}">link</a>

In my browser, when I click "link", I have in the address bar:

  • With angularjs 1.5.8, I get this :

    mywebsite/#/rubric/AOO which is exactly what I want

But

  • With angularjs 1.6.1, I get this :

    mywebsite/#!#%rubric%2FAOO which is not what I want

Please, where is the problem ? Where am I wrong ?


Solution

  • replace it with:

    <a ng-href="#!/rubric/{{ data }}">link</a>
    

    you should add ! in ng-href