Concerning error on failure: syntax error, unrecognized expression
I am implementing angular + node js app. I am new to this. I have defined href as <li><a data-toggle="modal" data-target="#myModal" href="/#/login">Login</a></li>
in html page and defined route as
.when("/login", {
templateUrl: '/app/ng/modules/home/partials/login-partials-view.html',
controller: 'LoginController'
})
I am getting a question like
Unprepared error: syntax error, unrecognized expression: / # / login
Can anyone suggest me what is causing the problem?
+3
source to share
1 answer
You entered the wrong URL: this is # / login
<li><a data-toggle="modal" data-target="#myModal" href="#/login">Login</a></li>
If you want to use the .state method, follow these steps:
.state('login', {
url: "/login",
templateUrl: "/app/ng/modules/home/partials/login-partials-view.html"
})
Then you can use ui-sref like this:
<li><a data-toggle="modal" data-target="#myModal" ui-sref="login">Login</a></li>
0
source to share