I'm trying to figure out why the page doesn't navigate to its template when clicked. The URL updates, and I have no JS errors.. I believe it loads the file, but then it infinitely loads the controller. I found this out after I put a console.log('test!') in my SessionsController's instantiation.
The layout
<div ng-view></div>
My View
<a href="/testing"> My link of seriousness </a>
My JS
window.MainController = function($scope, $route, $routeParams, $location) {
$scope.$route = $route;
$scope.$location = $location;
$scope.$routeParams = $routeParams;
console.log($route);
console.log($location);
console.log($routeParams);
};
MainController.$inject = ["$scope", "$route"];
window.app = angular.module('web_client', [], function($routeProvider, $locationProvider) {
return $routeProvider.when('/testing', {
templateUrl: '/partials/other_stuff/index.html',
controller: 'MyController'
});
});
window.MyController = function($scope, $http) {
console.log('Infinite Loop!');
};
And in partials/sessions/new.html , I have big and bright :
FOOBAR!
sessions/new.htmlto show as the view when clicking on my link.. Perhaps I'm doing something else? I updated my answer, but jsfiddle won't work appropriately unless I have my views, controllers, routes, everything up there and then translated to javascript. I'm definitely sure there's no js errors at all.