here is my
angularroute.html
Remove everything that's not needed from your route template. Only the content that you added in your body of the template is required.
That will be included by angular into ng-view with the controller that you have configured in your route. It's a partial and not a complete html file.
Also your route.js code is not correct. You could create a module angular.module('route', []).controller('route1Controller', function(){...}) and use it as dependency in your app.
With-out the brackets like you did in your route.js you're getting a module that's already defined.
Please have a look at your updated code below or in this fiddle.
var AngApp = angular.module('AngularApp', ['ngRoute'])
.controller('Route1Controller', Route1Controller)
.controller('Route2Controller', Route2Controller);
AngApp.config(function ($routeProvider) {
$routeProvider
.when('/Route1/:ID', {
templateUrl:'Route1.html',
controller:'Route1Controller'
})
.when('/Route2', {
templateUrl: 'Route2.html',
controller:'Route2Controller'
})
.otherwise({
redirectTo: '/'
});
});
function Route1Controller($scope, $routeParams) {
$scope.ID = $routeParams.ID;
}
function Route2Controller($scope) {
}