{"id":23350671,"url":"https://github.com/nnmrts/controllerhandler","last_synced_at":"2025-07-22T05:04:36.278Z","repository":{"id":55045895,"uuid":"90449275","full_name":"nnmrts/ControllerHandler","owner":"nnmrts","description":"ControllerHandler simplifies controller initialization in AngularJS","archived":false,"fork":false,"pushed_at":"2021-01-13T07:54:40.000Z","size":489,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-07T18:19:59.463Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nnmrts.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-06T08:35:43.000Z","updated_at":"2017-05-06T08:39:53.000Z","dependencies_parsed_at":"2022-08-14T10:00:51.388Z","dependency_job_id":null,"html_url":"https://github.com/nnmrts/ControllerHandler","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nnmrts/ControllerHandler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nnmrts%2FControllerHandler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nnmrts%2FControllerHandler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nnmrts%2FControllerHandler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nnmrts%2FControllerHandler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nnmrts","download_url":"https://codeload.github.com/nnmrts/ControllerHandler/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nnmrts%2FControllerHandler/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266430671,"owners_count":23927167,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-21T08:17:15.657Z","updated_at":"2025-07-22T05:04:36.251Z","avatar_url":"https://github.com/nnmrts.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ControllerHandler\n\nControllerHandler is a small JavaScript constructor function for AngularJS.\n\nIt simplifies the process of declaring controllers and makes dependency injection a little bit easier.\n\n---\n\n## Example\n\nNormal controller declaring compared to that with ControllerHandler:\n\nVanilla:\n\n```js\n\n// MyController\n\nMyControllerFunction = function ($scope, $timeout, $window, $http, $q) {\n\n    // $scope.stuff ...\n\n};\n\nMyApp.controller(\"MyController\", [\"$scope\", \"$timeout\", \"$window\", \"$http\", \"$q\", MyControllerFunction]);\n\n\n// MyOtherController\n\nMyOtherControllerFunction = function ($scope, $timeout, $window, $http, $q) {\n\n    // $scope.stuff ...\n\n};\n\nMyApp.controller(\"MyOtherController\", [\"$scope\", \"$timeout\", \"$window\", \"$http\", \"$q\", MyOtherControllerFunction]);\n\n```\n\nUsing ControllerHandler:\n\n```js\n\n// MyController\n\nMyControllerFunction = function ($scope, $timeout, $window, $http, $q) {\n\n    // $scope.stuff ...\n};\n\nMyControllerHandler = new ControllerHandler({\n    app: MyApp,\n    name: \"MyController\",\n    code: MyControllerFunction,\n    debug: true\n});\n\n// MyOtherController\n\nMyOtherControllerFunction = function ($scope, $timeout, $window, $http, $q) {\n\n    // $scope.stuff ...\n};\n\nMyOtherControllerHandler = new ControllerHandler({\n    app: MyApp,\n    name: \"MyOtherController\",\n    code: MyOtherControllerFunction\n});\n\n```\n\nYou can find an example site where ControllerHandler is used in the example folder.\n\n## Features\n\nControllerHandler manages inline dependency injection for you, so you don't have to write down your depencies twice but at the same time your app still works when minified. Also, it gives you a nice little object to configure your controller and not some confusing arrays or parentheses.\n\nAnother feature is the `debug` option. If it is set to true, you can see all information about your controller(s) in your browser console.\n\n## Docs\n\nDownload this repository and open the index.html in the docs folder, there is everything explained in detail about how to use ControllerHandler.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnnmrts%2Fcontrollerhandler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnnmrts%2Fcontrollerhandler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnnmrts%2Fcontrollerhandler/lists"}