Menu link not working with $routeProvider

Asked

Viewed 94 times

1

I’m finding problems to work with $routeProvider of Angular.js, have a link in a menu in which it will be mapped via route of angular, and later will call a action in the Spring, but it doesn’t work. Always returns me 404 and I’ve changed the url in every possible way and yet it doesn’t work.

Below is the link HTML, as well as the configuration of my preview:

<li>
    <a class="tooltip-tip ajax-load" href="#" title="Clientes"><i class="entypo-user"></i><span>Clientes</span></a>
    <ul>
        <li><a class="tooltip-tip2 ajax-load" href="${pageContext.request.contextPath}/auth/#/customer" title="Novo Cliente"><i class="entypo-newspaper"></i><span>Novo Cliente</span></a></li>
    </ul>
</li>




  var app = angular.module('customer', []);

    app.config(function($routeProvider, $locationProvider){
        console.log('Acesso a Configuração do RouteProvider.');
        $routeProvider.when('/customer', {
            templateUrl: '/auth/customer',
            controller: 'customerController'
        }).otherwise({
            redirectTo: '/customer'
        });
    });
  • 1

    Try changing the href upstairs to: href="#/customer"

  • So @Pedrolaini I tried but nothing happens! A url kind of concatenated: .../viatge/auth/home#/customer and does not enter the debug so much of Google Chrome how much mine action on the server side.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.