I am getting error method1 () is undefined. What is the proper way to invoke a method during init?
gdmsDashboard.controller('DashboardController', '$scope') {
$scope.Msg = "";
(function init() {
$scope.method1 ();
method1 ();
this.method1 ();
})();
$scope.method1 = function () {
//
}
}
init,runmethod ?variable hoisting concept$scope.logoutbefore the iife statement.