AngularJS Dynamic loading a controller
I read a lot about lazzy loading, but I am facing a problem when using $routeProvider. My goal is to load a javascript file which contains a controller and add a route to this controller which has been loaded previously. Content of my javascript file to load angular.module('demoApp.modules').controller('MouseTestCtrlA', ['$scope', function ($scope) { console.log("MouseTestCtrlA"); $scope.name = "MouseTestCtrlA"; }]); This file is not included when angular bootstap is called. It means, I have to load the file and create a route to this controller. First, I started writing a resolve function