0
I am developing a web application with Angularjs 1.6, and I am encountering an error only when I open index.html directly from the page. However, when running directly from the IDE it works normally. Follows print of error:
Code of index.html:
<body ng-app="codeAmApp">
<div ng-controller="myCtrl" class="container">
<div class="btn-group btn-block">
<a class="btn btn-success pull-right" href="#!categoria"> + Categoria </a>
<a class="btn btn-success pull-right" href="#!tarefa"> + Tarefa </a></button>
<a ng-click="mostrar = !mostrar" ng-show="mostrar" class="btn btn-success pull-right" href="#!listaPorCategoria"> Lista de tarefas por categoria </a></button>
<a ng-click="mostrar = !mostrar" ng-hide="mostrar" class="btn btn-success pull-right" href="#/!"> Lista de tarefas </a></button>
</div>
<div ng-view></div>
</div>
</body>
Code of the Angularjs:
var codeAmApp = angular.module('codeAmApp', ["ngRoute"]);
codeAmApp.config(function($routeProvider) {
$routeProvider
.when("/", {
templateUrl : "porTarefa.html"
})
.when("/categoria", {
templateUrl : "categoria.html"
})
.when("/tarefa", {
templateUrl : "tarefa.html"
})
.when("/listaPorCategoria", {
templateUrl : "porCategoria.html"
})
.otherwise({
redirectTo: '/'
});
});