Aye*_*win 6 angularjs angularjs-directive angularjs-scope angular-ui-router
我不知道如何解决这个案子.
错误:[$ location:nobase] HTML5模式下的$ location需要有标签!http://errors.angularjs.org/1.5.7/ $ location/nobase at angular.js:68 at $ LocationProvider.$ get(angular.js:13384)at Object.invoke(angular.js:4709)at angular .js:4508 at getService(angular.js:4675)atAngs(angular.js:4679)atAject #invoke(angular.js:4701)at angular.js:4508 at getService(angular.js:4655)at injectionArgs (angular.js:4679)
nik*_*ohn 10
设置时会发生这种情况html5mode,如下所示:
$locationProvider.html5Mode({
enabled: true,
requireBase: false
});
Run Code Online (Sandbox Code Playgroud)
只需在HTML模板中添加标记,如下所示:
<head>
<base href="/">
...
</head>
Run Code Online (Sandbox Code Playgroud)
这与文档中提到的完全相同:https://docs.angularjs.org/error/ $ location/nobase
| 归档时间: |
|
| 查看次数: |
9071 次 |
| 最近记录: |