javascript – ng-View does not render content – AngularJS

Question:

When I access my index.php, I ask in my Angular route configuration that it call the view "index.php" inside the "view" folder, but it does not think so but doesn't 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 href="/assets/css/bootstrap.min.css">
	<link 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>

Answer:

then! almost certainly it is the lack of the controller call: that you defined there.

<div ng-controller="search" ng-view>
ou
<div ng-controller="search">
   <div ng-view>
</div>
Scroll to Top