{"action":"created","issue":{"url":"https://api.github.com/repos/ocombe/ocLazyLoad/issues/159","labels_url":"https://api.github.com/repos/ocombe/ocLazyLoad/issues/159/labels{/name}","comments_url":"https://api.github.com/repos/ocombe/ocLazyLoad/issues/159/comments","events_url":"https://api.github.com/repos/ocombe/ocLazyLoad/issues/159/events","html_url":"https://github.com/ocombe/ocLazyLoad/issues/159","id":66371270,"number":159,"title":"Controller not registering","user":{"login":"warcops","id":3818479,"avatar_url":"https://avatars.githubusercontent.com/u/3818479?v=3","gravatar_id":"","url":"https://api.github.com/users/warcops","html_url":"https://github.com/warcops","followers_url":"https://api.github.com/users/warcops/followers","following_url":"https://api.github.com/users/warcops/following{/other_user}","gists_url":"https://api.github.com/users/warcops/gists{/gist_id}","starred_url":"https://api.github.com/users/warcops/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/warcops/subscriptions","organizations_url":"https://api.github.com/users/warcops/orgs","repos_url":"https://api.github.com/users/warcops/repos","events_url":"https://api.github.com/users/warcops/events{/privacy}","received_events_url":"https://api.github.com/users/warcops/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-04-04T21:46:30Z","updated_at":"2015-06-22T17:15:08Z","closed_at":"2015-04-09T20:05:24Z","body":"Hi,\r\n\r\nI am getting the following error message:\r\n```\r\nError: [ng:areq] Argument 'HomeController' is not a function, got undefined\r\n```\r\nFollowing is the code for module:\r\n```\r\nvar MyApp = angular.module(\"MyApp\", [\r\n    \"ui.router\",\r\n    \"oc.lazyLoad\"\r\n]);\r\n\r\nMyApp.config(['$stateProvider', '$urlRouterProvider', '$ocLazyLoadProvider', function ($stateProvider, $urlRouterProvider, $ocLazyLoadProvider) {\r\n\r\n    //Redirect any unmatched url\r\n    $urlRouterProvider.otherwise(\"/\");\r\n    $stateProvider\r\n\r\n    //home\r\n    .state('home', {\r\n        url: \"/\",\r\n        templateUrl: \"template/home/home-main.html\",\r\n        controller: \"HomeController\",\r\n        resolve: {\r\n            deps: ['$ocLazyLoad', function ($ocLazyLoad) {\r\n                return $ocLazyLoad.load({\r\n                    name: 'MyApp',\r\n                    files: [\r\n                            //TODO add all the required css and js\r\n\r\n                            '../script/app/controllers/HomeController.js'\r\n                        ]\r\n                });\r\n            }]\r\n        }\r\n    });\r\n\r\n   $ocLazyLoadProvider.config({\r\n      debug: true,\r\n      events: true,\r\n        loadedModules:['MyApp']\r\n    });\r\n\r\n}]);\r\n```\r\n\r\nThe code in HomeController.js is as follows:\r\n```\r\nMyApp.controller('HomeController', ['$rootScope', '$scope', function($rootScope, $scope) {\r\n    $scope.$on('$viewContentLoaded', function() {   \r\n        //TODO logic for after view is loaded\r\n    });\r\n}]);\r\n```\r\n\r\nFollowing are the version details:\r\n\r\n* AngularJS v1.3.15\r\n* ocLazyLoad v1.0.0-alpha2\r\n\r\nI am not sure what I am doing wrong here. A quick reply would be much appreciated."},"comment":{"url":"https://api.github.com/repos/ocombe/ocLazyLoad/issues/comments/114185744","html_url":"https://github.com/ocombe/ocLazyLoad/issues/159#issuecomment-114185744","issue_url":"https://api.github.com/repos/ocombe/ocLazyLoad/issues/159","id":114185744,"user":{"login":"warcops","id":3818479,"avatar_url":"https://avatars.githubusercontent.com/u/3818479?v=3","gravatar_id":"","url":"https://api.github.com/users/warcops","html_url":"https://github.com/warcops","followers_url":"https://api.github.com/users/warcops/followers","following_url":"https://api.github.com/users/warcops/following{/other_user}","gists_url":"https://api.github.com/users/warcops/gists{/gist_id}","starred_url":"https://api.github.com/users/warcops/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/warcops/subscriptions","organizations_url":"https://api.github.com/users/warcops/orgs","repos_url":"https://api.github.com/users/warcops/repos","events_url":"https://api.github.com/users/warcops/events{/privacy}","received_events_url":"https://api.github.com/users/warcops/received_events","type":"User","site_admin":false},"created_at":"2015-06-22T17:15:08Z","updated_at":"2015-06-22T17:15:08Z","body":"@mastermoin : why are you using require like syntax here? any specific reason?"}}