Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Controller not getting register and called #414

Open
pinal-r opened this issue Jan 12, 2018 · 0 comments
Open

Controller not getting register and called #414

pinal-r opened this issue Jan 12, 2018 · 0 comments

Comments

@pinal-r
Copy link

pinal-r commented Jan 12, 2018

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");
});
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant