I will show you the code on jsbin. the issue is : $scope.name never show,thank you
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.14/angular.min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body ng-app="test">
<a href="#/you">go to</a>
<ng-view></ng-view>
<script type="text/ng-template" id="you.html">
{{name}}
</script>
</body>
</html>
js:
var test = angular.module('test',[]);
test.config(function($rootProvider){
$rootProvider
.when('/you',{
templateUrl: 'you.html',
controller: 'youCtrl'
});
});
test.controller('youCtrl',function($scope){
$scope.name = 'you';
});
$routeProvidernot$rootProviderand you need to add thengRoutedependency