I'm developing a web application with AngularJS 1.6, and I'm encountering an error only when I open index.html right from the page. However, when running directly from the IDE it works normally. Here is the error print:
Index.htmlcode:
<bodyng-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>
Angular Code JS:
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: '/'
});
});