Salut, je fait faire une simple exemple pour dirigée entre différents page en angular js

voici code de l'exemple qui ne marche pas

code 1.html
Code html : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<!DOCTYPE html>
<html>
<head>
	<title></title>
</head>
<body ng-app="MonApp">
	  <div ng-view></div>
 
	  	<script type="text/javascript" src="js/angular.min.js"></script>
 
		<script src="js/angular-route.min.js"></script>
 
		<script type="text/javascript" src="js/for.js"></script>
 
 
</body>
</html>

code index.html

Code html : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<!DOCTYPE html>
<html>
<head>
	<title>test</title>
</head>
<body ng-app="MonApp">
 
<div ng-controller="TestCtrl">
 
	<input type="text" placeholder="votre nom">
	<input type="text" votre prenom="votre prenom">
	<a href="#/for"><button ng-click="test()">envoyer</button></a>
 
 
</div>
 
			<script type="text/javascript" src="js/angular.min.js"></script>
 
		<script src="js/angular-route.min.js"></script>
 
		<script type="text/javascript" src="js/for.js"></script>
 
</body>
</html>

code for.html
Code html : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<!DOCTYPE html>
<html>
	<head>
		<title>for</title>
	</head>
 
	<body ng-app="MonApp" >
 
		<div ng-controller="ForCtrl"> 
		<input type="text" placeholder="tapez votre valeur" ng-model="test">
		<button ng-click="calcul_factorielle()">Factorielle</button> <br>
		{{factorielle}}
		</div>
 
		<script type="text/javascript" src="js/angular.min.js"></script>
 
		<script src="js/angular-route.min.js"></script>
 
		<script type="text/javascript" src="js/for.js"></script>
 
	</body>
</html>


code for.js
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
var app = angular.module('MonApp', ['ngRoute'])
 
app.config(function($routeProvider) {
        $routeProvider
 
          .when('/',{templateUrl: 'for/for.html',controller: 'ForCtrl'})
          .when('/index',{templateUrl: 'for/index.html',controller: "TestCtrl"})
          .otherwise({redirectTo : '/'});
    });
 
app.controller('ForCtrl', function($scope) {
 
	$scope.calcul_factorielle = function(){
 
		var mm = 1;
		console.log(mm);
		for(i=2;i<=$scope.test;i++) {
			mm = mm * i;
		}
 
		$scope.factorielle = mm;
}
 
 
/* FIN DU CONTROLEUR */
 
 
});
 
 
app.controller('TestCtrl', function($scope) {
 
	$scope.test = function() {
		document.write("test");
	}
});
quelle est la solution pour la code est fonctionne et merci d'avance