我是angularjs的新手,正在尝试创建登录页面。它之前工作正常,但现在我使用ngStorage.min.js来存储响应,然后我的index.html现在不能正常工作。
我在Mozilla Firefox中遇到错误,但我的Chrome中没有任何内容。
GET http://127.0.0.1:49905/index.html [HTTP/1.1 200 OK 3ms]
GET https://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css [HTTP/1.1 304 Not Modified 255ms]
GET https://cdn.rawgit.com/cornflourblue/angular-registration-login-example/master/app-content/app.css [HTTP/1.1 304 Not Modified 267ms]
GET http://127.0.0.1:49905/css/login.css [HTTP/1.1 200 OK 5ms]
GET http://127.0.0.1:49905/css/register.css [HTTP/1.1 200 OK 4ms]
GET http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js [HTTP/1.1 304 Not Modified 323ms]
GET https://code.angularjs.org/1.2.20/angular.js [HTTP/1.1 304 Not Modified 1021ms]
GET https://code.angularjs.org/1.2.20/angular-route.js [HTTP/1.1 304 Not Modified 1294ms]
GET https://code.angularjs.org/1.2.13/angular-cookies.js [HTTP/1.1 304 Not Modified 1294ms]
GET http://127.0.0.1:49905/js/ngStorage.min.js [HTTP/1.1 304 Not Modified 317ms]
GET http://127.0.0.1:49905/js/ngStorage.js [HTTP/1.1 304 Not Modified 318ms]
GET http://127.0.0.1:49905/app.js [HTTP/1.1 304 Not Modified 318ms]
GET http://127.0.0.1:49905/app-services/authentication.service.js [HTTP/1.1 304 Not Modified 319ms]
GET http://127.0.0.1:49905/app-services/user.service.js [HTTP/1.1 304 Not Modified 319ms]
GET http://127.0.0.1:49905/app-services/flash.service.js [HTTP/1.1 304 Not Modified 320ms]
GET http://127.0.0.1:49905/controller/home.controller.js [HTTP/1.1 304 Not Modified 320ms]
GET http://127.0.0.1:49905/controller/login.controller.js [HTTP/1.1 304 Not Modified 325ms]
GET http://127.0.0.1:49905/controller/userdata.controller.js [HTTP/1.1 304 Not Modified 325ms]
GET http://127.0.0.1:49905/controller/register.controller.js [HTTP/1.1 304 Not Modified 325ms]
GET http://127.0.0.1:49905/controller/resetpassword.controller.js [HTTP/1.1 304 Not Modified 325ms]
GET http://127.0.0.1:49905/app-services/user.service.js [HTTP/1.1 304 Not Modified 1ms]
我的 index.html
<!DOCTYPE html>
<html ng-app="app">
<head>
<meta charset="utf-8" />
<title></title>
<link rel="stylesheet" href="https://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" />
<link href="https://cdn.rawgit.com/cornflourblue/angular-registration-login-example/master/app-content/app.css" rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="css/login.css">
<link rel="stylesheet" type="text/css" href="css/register.css">
</head>
<body>
<div class="main-wrapper" >
<div ng-class="{ 'alert': flash, 'alert-success': flash.type === 'success', 'alert-danger': flash.type === 'error' }" ng-if="flash" ng-bind="flash.message"></div>
<div ng-view></div>
</div>
<div class="credits text-center">
</div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="https://code.angularjs.org/1.2.20/angular.js"></script>
<script src="https://code.angularjs.org/1.2.20/angular-route.js"></script>
<script src="https://code.angularjs.org/1.2.13/angular-cookies.js"></script>
<script src="js/ngStorage.min.js"></script>
<script src="js/ngStorage.js"></script>
<script src="app.js"></script>
<script src="app-services/authentication.service.js"></script>
<!-- real time API storage-->
<script src = "app-services/user.service.js"></script>
<script src="app-services/flash.service.js"></script>
<!-- Fake user service for demo that uses local storage -->
<script src="app-services/user.service.js"></script>
<script src="controller/home.controller.js"></script>
<script src="controller/login.controller.js"></script>
<script src="controller/userdata.controller.js"></script>
<script src="controller/register.controller.js"></script>
<script src="controller/resetpassword.controller.js"></script>
</body>
</html>
答案 0 :(得分:0)
我注意到你已经两次包含了ngStorage脚本:
<script src="js/ngStorage.min.js"></script>
<script src="js/ngStorage.js"></script>
尝试删除其中一行并进行硬刷新(Shift +点击重新加载),看看是否有帮助。