0

I'm new to AngularJS. I'm trying to set the navigation between links through AngularJS routing . I do everything the manuals says, But I get that error.

I'm trying to migrate my working code with plain JavaScript and jQuery to AngularJS. The navigation occurs, but it shows several errors of that type in console, like:

Uncaught Error: Syntax error, unrecognized expression: #!/about and

Uncaught Error: Syntax error, unrecognized expression: #!/#%2F!

In my about section I have a jQuery UI accordion, but now in AngularJS it doesn`t work anymore.

I really don't know what's happening and would like to know in order to be able to solve this kind of issues in the future.

This is my little code, please, be nice fellows and help me out figure out what I am doing wrong.

$(document).ready(function () {
var app = angular.module("evalApp", ["ngRoute"])

    app.config(function($routeProvider) {
        $routeProvider
        .when("/", {
            templateUrl : "content.html"                
        })
        .when("/about", {
            templateUrl : "sobremi.html"
        })

    });

})

And in the html this is the relevant code:

<li><a href="#/!">Inicio</a></li>
<li><a href="#!about">Sobre mi</a></li>

I'm loading the separate templates in the div with the ng-view directive

Thanks.

2
  • add this: href='/' & href='/about' Commented Jan 14, 2019 at 6:25
  • Try like this.. <li><a ng-href="#!">Inicio</a></li> <li><a ng-href="#!about">Sobre mi</a> Commented Jan 14, 2019 at 6:28

1 Answer 1

1

Seems like this question is similar to yours. Their solution was to add data-target="#" to the links.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.