Sunday, March 12, 2017

Laravel adds "!#" to the root URL when clicking a Link with #

I'm trying to make my AngularJS routes work with Laravel 5.4. But I have a problem.

In my Welcome.blade.php file I have these links :

    <ul class="nav navbar-nav navbar-right">
      <li><a href="#/list">List </a></li>
      <li><a href="#/contact">Contact</a></li>
    </ul>

Whenever I click a link, the URL changes to http://127.0.0.1:8000/#!#%2Flist or http://127.0.0.1:8000/#!#%2Fcontactinstead of http://127.0.0.1:8000/#/list or http://127.0.0.1:8000/#/contact. And I can't use AngularJS routing using $routeProvider this way.

How can I fix it please? Thank you in advance



via dwix

Advertisement