Open pinal-r opened 6 years ago
I have added below config for controller
$ocLazyLoadProvider.config({ 'debug': true, // For debugging 'true/false' 'events': true, // For Event 'true/false' 'modules': [{ // Set modules initially name : 'usersCtrl', // State1 module files: ['protected/controllers/usersCtrl.js'] }] });
on route
$stateProvider.state('users', { url: "/users", views : { "" : { templateUrl:"protected/views/users.html" } }, resolve: { loadMyCtrl: ['$ocLazyLoad', function($ocLazyLoad) { return $ocLazyLoad.load('usersCtrl'); // Resolve promise and load before view }] } });
usersCtrl.js gets loaded i can see that in network but not executing. i kept console alert but nothing worker.
app.controller('usersCtrl', function ($scope, $rootScope, $state, $timeout, $http, $mdDialog,$stateParams,$mdToast,$sce,formatDate)
console.log("controller call");
angular.element(document).ready(function () { console.log("ready"); }); });
I have added below config for controller
$ocLazyLoadProvider.config({ 'debug': true, // For debugging 'true/false' 'events': true, // For Event 'true/false' 'modules': [{ // Set modules initially name : 'usersCtrl', // State1 module files: ['protected/controllers/usersCtrl.js'] }] });
on route
$stateProvider.state('users', { url: "/users", views : { "" : { templateUrl:"protected/views/users.html" } }, resolve: { loadMyCtrl: ['$ocLazyLoad', function($ocLazyLoad) { return $ocLazyLoad.load('usersCtrl'); // Resolve promise and load before view }] } });
usersCtrl.js gets loaded i can see that in network but not executing. i kept console alert but nothing worker.
app.controller('usersCtrl', function ($scope, $rootScope, $state, $timeout, $http, $mdDialog,$stateParams,$mdToast,$sce,formatDate)
console.log("controller call");
angular.element(document).ready(function () { console.log("ready"); }); });