javascript - 为什么 Angulars JS 在 URL routeProvider 中给出错误?

标签 javascript angularjs url-routing single-page-application angularjs-routing

我在 Angular JS 中使用 routeProvider。我的链接看起来像:

www.site.com/profile#/profile/profession/3

Angular JS 指出页面中有错误:

Uncaught Error: Syntax error, unrecognized expression: .nav-tabs a[href=#/profile/profession/3]

最佳答案

你必须像这样给你的 href 表达式添加引号

.nav-tabs a[href="#/profile/profession/3"]

关于javascript - 为什么 Angulars JS 在 URL routeProvider 中给出错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30095035/

相关文章:

JavaScript 如何将 %20 替换为空格

javascript - Ember 无法正确配置路由

java - 如何管理 Spring MVC 上的错误 URL?

javascript - jQuery keyup = 而不是 ==

javascript - Angular js 表单输入中的 $isEmpty 功能

javascript - 我如何在 angularJs 应用程序中从服务器生成并下载 zip 文件?

javascript - 作为对象参数的动态路径

javascript - Node 中带有 Express 框架的动态路由

javascript - 使用正则表达式更改img src

javascript - 编辑器 js : Tap in created table