3
When I access my index.php, I ask in my Angular route settings that it calls the "index.php" view inside the "view" folder, but it finds but does not render anything on my screen
var app = angular.module('app',['ngRoute']);
app.config(function($routeProvider,$locationProvider){
$routeProvider
.when('/',{
templateUrl: 'view/index.php',
controller:'search'
}).otherwise({redirectTo:"/"})
//Se descomentar tbm não funciona
//$locationProvider.html5Mode(true);
})
<!DOCTYPE html>
<html lang="en" ng-app="app">
<head>
<meta charset="UTF-8">
<title>Document</title>
<link rel="stylesheet" href="/assets/css/bootstrap.min.css">
<link rel="stylesheet" href="/assets/css/font-awesome.min.css">
</head>
<body>
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<a class="navbar-brand" href="#">Teste</a>
<ul class="nav navbar-nav">
<li><a href="">Home</a></li>
<li><a href=""></a></li>
<li><a href=""></a></li>
<li><a href=""></a></li>
<li><a href=""></a></li>
</ul>
</div>
</nav>
<div ng-view>
</div>
<script src="/assets/js/jquery.js"></script>
<script src="/assets/js/bootstrap.min.js"></script>
<script src="/angularapp/setup/angular.min.js"></script>
<script src="/angularapp/setup/angular.min.js.map"></script>
<script src="/angularapp/setup/angular-route.min.js"></script>
<script src="/angularapp/setup/angular-route.min.js.map"></script>
<script src="/angularapp/config.js"></script>
<script src="/angularapp/controllers/search.js"></script>
</body>
</html>
This is not necessary. The controller will be instantiated when the view renders the page.
– mutlei
Hello Luiz, thanks for your attention, but warn me it was silly, I had reversed the name of a controller in the configs, I fixed it! Vlw
– Guilherme Diego