Console Errors Warning

0

The following warnings are appearing on the console with chrome:

"Uncaught TypeError: $ is not a function bootstrap.js: 29"

"SyntaxError: Unexpected token [angular.js: 12330"

Follow my code:

<!DOCTYPE html>
<html ng-app="fluxo">
<head>
<title>Fluxojoin</title>
<meta charset="utf8">
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script type="text/javascript"  src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.3/angular.min.js"></script><scripttype="text/javascript" src="js/angular-route.js"></script>
<script type="text/javascript" src="bootstrap/js/bootstrap.js"></script>

<link rel="stylesheet" type="text/css" href="bootstrap/css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="bootstrap/css/bootstrap-responsive.css">
<link rel="stylesheet" type="text/css" href="css/fj.css">

<script>
angular.module("fluxo", ["ngRoute"]);

angular.module("fluxo").config(function ($routeProvider) {
    $routeProvider.when("/entradas", {
        templateUrl: "views/entradas.html",
        controller: "fluxoCtrl"
});
$routeProvider.when("/saidas", {
    templateUrl: "views/saidas.html",
    controller: "fluxoCtrl"
});
$routeProvider.otherwise({redirectTo: "/index"});
});

angular.module("fluxo").controller("fluxoCtrl", function ($scope, $http) {

var mostraTodasContasEntradas = function () {
    $http.get("php/index.php").success(function (data){

    });
}

mostraTodasContasEntradas();

});
</script>

</head>
<body ng-controller="fluxoCtrl">
    <div ng-include="'views/links.html'"></div>
    <div ng-view></div>


</body>
</html>
    
asked by anonymous 10.11.2015 / 11:59

1 answer

4

Your $routeProvider is set wrong, you only need one setting for it, not one for each .when .

Try the following:

$routeProvider
.when("/entradas", {
    templateUrl: "views/entradas.html",
    controller: "fluxoCtrl"
})
.when("/saidas", {
    templateUrl: "views/saidas.html",
    controller: "fluxoCtrl"
})
.otherwise({redirectTo: "/index"});

Edit:

Actually, by reading the bootstrap documentation, I noticed that Jquery is really missing, as @devgaspar said.

  

Also note that all plugins depend on jQuery (this means jQuery must be included before the plugin files).

     

Note that all plugins depend on jQuery (it means that jQuery should be started before bootstrapping).

Then my previous solution does not solve your problem of the first console error, but remains as an indication of improvement in the code.

    
10.11.2015 / 12:06