{"id":34995628,"url":"https://github.com/paragdiwan/ng-ts","last_synced_at":"2026-04-16T03:31:55.465Z","repository":{"id":86377733,"uuid":"91896321","full_name":"paragdiwan/ng-ts","owner":"paragdiwan","description":"Angular Controller using Typescript","archived":false,"fork":false,"pushed_at":"2017-05-22T18:41:26.000Z","size":415,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-28T15:07:09.058Z","etag":null,"topics":["angular","html","javascript","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/paragdiwan.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2017-05-20T14:58:53.000Z","updated_at":"2017-05-21T20:24:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"75e2c4de-df8e-4f66-8bc0-abeadb24e7c9","html_url":"https://github.com/paragdiwan/ng-ts","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/paragdiwan/ng-ts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paragdiwan%2Fng-ts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paragdiwan%2Fng-ts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paragdiwan%2Fng-ts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paragdiwan%2Fng-ts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paragdiwan","download_url":"https://codeload.github.com/paragdiwan/ng-ts/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paragdiwan%2Fng-ts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31870506,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T15:24:51.572Z","status":"online","status_checked_at":"2026-04-16T02:00:06.042Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","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":["angular","html","javascript","typescript"],"created_at":"2025-12-27T02:05:51.461Z","updated_at":"2026-04-16T03:31:55.456Z","avatar_url":"https://github.com/paragdiwan.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ng-ts\nAngular Controller using Typescript\n---------------\n- This is an attempt to create a Angular 1.x controller using Typescript.\n- This controller demonstrates usuage of '$http' service.\n- Angular controller is being mapped to Typescript Class and interfaces enforces that \n  we define models , actions that are implemented by a controller class.\n  \n  All you need is to paste the entire folder in 'webroot' and run index.html.\n   \n   Snippet\n   --------\n   \n   ```javascript\n     \n    module MyApplication {\n    /**\n        *  An interface enforces that we expose appropriate models and actions required\n        *  on these models to the Controller.\n        */\n        export interface IMessage {\n            displayText: string;\n            flag: boolean;\n            serviceResponse: any;\n            changeScopeModel(): void;\n        }\n\n        /**\n        * A Controller class that exposes models via member variables and methods.\n        */\n        export class DemoMVVMCtrl implements IMessage {\n            displayText: string; // Demo MV on the UI.\n            flag: boolean; // Toggle switch\n            serviceResponse: any; // Demo Service response model.\n            static $inject = ['dataAccessService'];\n            constructor(private dataAccessService: common.services.DataAccessService) {\n                this.displayText = \"Welcome to Typescript\";\n                this.flag = true;\n            }\n\n            changeScopeModel() {\n                this.flag = !this.flag;\n                if (this.flag) {\n                    this.displayText = \"You are loving TS.\"\n                }\n                else {\n                    this.displayText = \"Welcome to Typescript\";\n                }\n            }\n\n            /**\n            * Talks to remote service to get data.\n            */\n            getDataFromService() {\n                try {\n                    this.dataAccessService.getDataFromResource().then((response) =\u003e {\n                        try {\n                            this.serviceResponse = response.data;\n                        }\n                        catch (exception) {\n                            throw exception;\n                        }\n                    })\n                }\n                catch (exception) {\n                    throw exception;\n                }\n            }\n        }\n\n        // Create a model along with Service dependency \u0026 Register a controller.    \n        angular.module('app', ['common.services'])\n            .controller(\"DemoMVVMCtrl\", MyApplication.DemoMVVMCtrl);\n    }\n\n  ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparagdiwan%2Fng-ts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparagdiwan%2Fng-ts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparagdiwan%2Fng-ts/lists"}