{"id":14973565,"url":"https://github.com/gallayl/angular2-odata","last_synced_at":"2025-10-27T01:30:39.891Z","repository":{"id":57179718,"uuid":"58189000","full_name":"gallayl/angular2-odata","owner":"gallayl","description":"OData service for Angular2","archived":false,"fork":false,"pushed_at":"2017-01-18T07:46:20.000Z","size":122,"stargazers_count":32,"open_issues_count":5,"forks_count":13,"subscribers_count":13,"default_branch":"master","last_synced_at":"2024-10-30T06:40:40.683Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gallayl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-05-06T07:24:50.000Z","updated_at":"2019-10-07T19:32:35.000Z","dependencies_parsed_at":"2022-09-14T03:30:40.957Z","dependency_job_id":null,"html_url":"https://github.com/gallayl/angular2-odata","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gallayl%2Fangular2-odata","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gallayl%2Fangular2-odata/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gallayl%2Fangular2-odata/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gallayl%2Fangular2-odata/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gallayl","download_url":"https://codeload.github.com/gallayl/angular2-odata/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238418232,"owners_count":19468869,"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","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-09-24T13:48:57.888Z","updated_at":"2025-10-27T01:30:39.598Z","avatar_url":"https://github.com/gallayl.png","language":"JavaScript","readme":"# angular2-odata\nThe goal is to create a fluent API for querying, creating, updating and deleting OData resources in Angular2.\nOData service for Angular.\n\nIf you are using OData with Angular\u003e2 please check also my other related project, [FuryTech.OdataTypescriptServiceGenerator](https://github.com/gallayl/FuryTech.OdataTypescriptServiceGenerator)\n\n##Usage example:\nGet the package from NPM:\nnpm install angular2-odata\n\n```\nimport { ODataConfiguration, ODataServiceFactory, ODataService } from \"angular2-odata\";\nimport { bootstrap } from \"angular2/platform/browser\";\n    \n@Injectable()\nclass MyODataConfig extends ODataConfiguration{\n    baseUrl=\"http://localhost:54872/odata/\";\n}\n\nbootstrap(app,[\n    provide(ODataConfiguration, {useClass:MyODataConfig}),\n    ODataServiceFactory,\n]\n\n//An example model interface\ninterface INotification {\n    Id: number;\n    CommentId: number;\n    Comment: IComment;\n    FromId: number;\n    From: IResource;\n    Priority: number;\n    SendDate: Date;\n    IsArchived: boolean;\n    Text: string;\n}\n\n//An example component\n@Component({\n  ...\n})\nexport class NotyListComponent{\n    private odata:ODataService\u003cINotification\u003e;\n    constructor(private odataFactory:ODataServiceFactory, ...){\n        this.odata = this.odataFactory.CreateService\u003cINotification\u003e(\"notification\");\n    }\n    \n    getOneNoty(id:int){\n        this.odata.Get(id).Select(\"Id,Text\").Expand(\"From,To\").Exec()\n        .subscribe(\n            singleNoty=\u003e{...},\n            error=\u003e{...}\n        );\n    }\n      \n      \n    getNotys(){\n        this.odata\n        .Query()                    //Creates a query object\n        .Top(this.top)    \n        .Skip(this.skip)\n        .Expand(\"Comment,From\")\n        .OrderBy(\"SendDate desc\")\n        .Filter(this.filterString)\n        .Exec()                     //Fires the request\n        .subscribe(                 //Subscribes to Observable\u003cArray\u003cT\u003e\u003e\n        notys =\u003e {\n            this.notys = notys;     //Do something with the result\n        },\n        error =\u003e {\n            ...                     //Local error handler\n        });\n    \n    }\n}\n```\n","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgallayl%2Fangular2-odata","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgallayl%2Fangular2-odata","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgallayl%2Fangular2-odata/lists"}