I find unsatisfactory solve, where templateUrl define at routeProvider, and at controller it redefine. But it is one excess request. (PS: I have my templates at any folder and I have hash-routes with name of this templates, how can I do this(render my template at current hash) correctly?)
For example this code render my index.html template at ng-view tag:
angular.module('amiu', [])
.config(function($routeProvider){
$routeProvider
.when('/index/', {templateUrl:'partitials/index.html'})
})
But I want to do that:
angular.module('amiu', [])
.config(function($routeProvider, $routeParams){
$routeProvider
.when('/:page/', {templateUrl:'template/'+$routeParams.page+'.html'})
.otherwise({redirectTo:"/"})
})
How can I do that?