I am using AngularJS and when I began to use routeprovider, if I reload the page occur a infinite load.
It's funny, because when I try to load the main page the first time, the page starts fine.
Here is my code:
var app = angular.module("platwip", []);
app.config(['$routeProvider', function($routeProvider) {
$routeProvider.
when('/status', {templateUrl: 'resources/views/html_files/status/status.dust', controller: TestCtrl}).
when('/network/wan', {templateUrl: '/resources/viewsAngular/network/wanAngular.html', controller: WanCtrl}).
otherwise({redirectTo: '/status'});
}]);
app.run(function($templateCache,$http){
$http.get('resources/viewsAngular/menus/sideMenu.html', {cache:$templateCache});
$http.get('resources/viewsAngular/menus/topMenu.html', {cache:$templateCache});
});
My Html:
<!DOCTYPE html>
<html ng-app="platwip">
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<link media="screen" type="text/css" rel="stylesheet" href="/resources/css/estilo.css"></link>
<script src="/resources/js/jquery/jquery-1.8.1.min.js" ></script>
<script src="/resources/js/jquery/jquery.i18n.min.js" ></script>
<script src="/src/controller/main/main.ws/messages" ></script>
<script src="/resources/js/jquery/jquery-ui-1.8.23.custom.min.js" ></script>
<script src="/resources/js/jquery/jquery.input-ip-address-control-1.0.min.js" ></script>
<script src="/resources/js/jquery/jquery.date.format.js" ></script>
<script src="/resources/js/jquery/jquery.address-1.5.min.js" ></script>
<script src="/resources/js/jquery/jquery.maskedinput-1.3.min.js" ></script>
<script src="/resources/js/jquery/jquery.validate.min.js" ></script>
<script src="/resources/js/validator_rules.js" ></script>
<script src="/resources/js/jquery/jquery.tablesorter.min.js" ></script>
<script src="/resources/js/angular/angular.min.js" ></script>
<script src="/resources/js/angular/controllers.js" ></script>
<script src="/resources/js/angular/partials.js" ></script>
<script src="/resources/js/angular/filters.js" ></script>
<script src="/resources/js/dust/dust-full-1.2.0.js" ></script>
<script src="/resources/js/dust/dust-helpers-1.1.1.js" ></script>
<script src="/resources/js/main.js" ></script>
</head>
<body>
<!-- <div id="qunit"></div>
<div id="qunit-fixture"></div> -->
<div id="container">
<div id="cabecalho">
<div id="barraSuperior"></div>
<div id="menuSuperior" ng-include src="'resources/viewsAngular/menus/topMenu.html'"/>
</div>
</div>
<noscript >
{{'Ops!! Seu navegador não está com o JavaScript habilitado. Para utilizar a aplicação você deve habilitar o JavaScript.' | i18n}}
<style type="text/css">
#conteudo { display:none; }
</style>
</noscript>
<div id="conteudo">
<div id="menuLateral" ng-include src="'resources/viewsAngular/menus/sideMenu.html'">
</div>
<div class="content">
<div id="titulo">
<h1></h1>
</div>
<div id='conteudoWeb' ng-view>
<div class='tab'>
</div>
</div>
</div>
<div class="clear"></div>
</div>
</div>
</body>
</html>
Has somebody an idea what is the problem?
Thank you!