Link problems using ngRoute Angular

2

I'm trying to create links. I'm working with AngularJS and did the route setup part. I have a 'Views' folder with the html files.

Follow the codes:

<html ng-app="fluxo">
<head>
<title>Fluxojoin</title>
<meta charset="utf8">
<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>
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="css/fj.css">

<script>
angular.module("fluxo", ["ngRoute"]);
angular.module("fluxo").controller("fluxoCtrl", function ($scope, $http) {

angular.module("fluxo").config(function ($routeProvider) {
    $routeProvider.when("/entradas", {
        templateUrl: "views/entradas.html"
    });
});

});
</script>

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

File entries.html

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

<div class="jumbotron" align="center">
<form name="contaEntradasForm">
    <input class="form-control" type="text" ng-model="" placeholder="Nome">
    <input class="form-control" type="text" ng-model="" placeholder="Email">
    <input class="form-control" type="text" ng-model="" placeholder="Senha">
</form>
</div>
    
asked by anonymous 06.11.2015 / 02:28

1 answer

3

Try to get the configuration of the Router from within the control. If the idea was to move the controller to the page you are rendering, then do it here below, passing the controller in the config itself:

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

angular.module("fluxo").config(function ($routeProvider) {
    $routeProvider.when("/entradas", {
        templateUrl: "views/entradas.html",
        controller: 'fluxoCtrl'
    });
});
  
angular.module("fluxo").controller("fluxoCtrl", function ($scope, $http) {

});
    
06.11.2015 / 02:44