Is there any way for me to change a view's controller in angular?
angular.module('app', [
'ngRoute'
]).
config(['$routeProvider', function($routeProvider) {
$routeProvider.when('/', {
templateUrl: 'views/home/index.html',
controller: 'home',
replace: false
})
$routeProvider.otherwise({redirectTo: '/'});
}]);
What I'm trying to do is give another controller for index.html in runtime.