{"id":18615056,"url":"https://github.com/andrewjbateman/angular-news-app","last_synced_at":"2025-04-11T00:31:06.571Z","repository":{"id":36801567,"uuid":"160019042","full_name":"AndrewJBateman/angular-news-app","owner":"AndrewJBateman","description":":clipboard: Angular app that displays news articles from a news API.","archived":false,"fork":false,"pushed_at":"2023-02-03T04:52:40.000Z","size":2928,"stargazers_count":5,"open_issues_count":4,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-25T06:51:16.463Z","etag":null,"topics":["angular","angular-material","angular-material15","angular15","api-rest","css","html5","http-client","news-api","news-articles","news-channel","observable","tutorial-code","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/AndrewJBateman.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-12-02T06:07:59.000Z","updated_at":"2024-06-23T18:25:45.000Z","dependencies_parsed_at":"2023-02-15T11:47:08.481Z","dependency_job_id":null,"html_url":"https://github.com/AndrewJBateman/angular-news-app","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/AndrewJBateman%2Fangular-news-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fangular-news-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fangular-news-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fangular-news-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AndrewJBateman","download_url":"https://codeload.github.com/AndrewJBateman/angular-news-app/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248322238,"owners_count":21084333,"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":["angular","angular-material","angular-material15","angular15","api-rest","css","html5","http-client","news-api","news-articles","news-channel","observable","tutorial-code","typescript"],"created_at":"2024-11-07T03:27:57.839Z","updated_at":"2025-04-11T00:31:01.559Z","avatar_url":"https://github.com/AndrewJBateman.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# :zap: Angular News App\n\n* Gets API news data and displays it in a format suitable for viewing on a phone.\n* Displays a left hand side navigation bar that allows the user to select a news channel. A single column displays news articles from this news channel.\n* The News API service from [newsapi](https://newsapi.org) is used to generate the articles. It now only works on localhost. It will not work when deployed due to CORS errors (error 406) which means they want you to pay a subscription to fully access the API.\n* Code from [article by Rashid Sakara](https://www.smashingmagazine.com/2018/10/news-application-with-angular-and-material-design/) - see [:clap: Inspiration](#clap-inspiration) below\n* **Note:** to open web links in a new window use: _ctrl+click on link_\n\n![GitHub repo size](https://img.shields.io/github/repo-size/AndrewJBateman/angular-news-app?style=plastic)\n![GitHub pull requests](https://img.shields.io/github/issues-pr/AndrewJBateman/angular-news-app?style=plastic)\n![GitHub Repo stars](https://img.shields.io/github/stars/AndrewJBateman/angular-news-app?style=plastic)\n![GitHub last commit](https://img.shields.io/github/last-commit/AndrewJBateman/angular-news-app?style=plastic)\n\n## :page_facing_up: Table of contents\n\n* [:zap: Angular News App](#zap-angular-news-app)\n  * [:page_facing_up: Table of contents](#page_facing_up-table-of-contents)\n  * [:books: General info](#books-general-info)\n  * [:camera: Screenshots](#camera-screenshots)\n  * [:signal_strength: Technologies](#signal_strength-technologies)\n  * [:floppy_disk: Setup](#floppy_disk-setup)\n  * [:computer: Code Examples](#computer-code-examples)\n  * [:cool: Features](#cool-features)\n  * [:clipboard: Status \u0026 To-Do List](#clipboard-status--to-do-list)\n  * [:clap: Inspiration](#clap-inspiration)\n  * [:file_folder: License](#file_folder-license)\n  * [:envelope: Contact](#envelope-contact)\n\n## :books: General info\n\n* Uses the model-view-viewmodel (MVVM) of Angular to bind the remote data that is stored in objects in the application template. The component plays the part of the controller/viewmodel. The template represents the view.\n* Very basic app to show news, does not use reactive programming best practices - specified function return types, typescript models, etc....\n\n## :camera: Screenshots\n\n![Example screenshot](./img/news-headlines.png).\n\n## :signal_strength: Technologies\n\n* [Angular v15](https://angular.io/)\n* [RxJS Library v7](https://angular.io/guide/rx-library) used to [subscribe](http://reactivex.io/documentation/operators/subscribe.html) to the API data [observables](http://reactivex.io/documentation/observable.html).\n* [News REST API v2](https://newsapi.org/) used to search for news articles.\n* [Angular Material Design v15](https://material.angular.io/) used for the user interface, especially [mat-menu](https://material.angular.io/components/menu/overview), [mat-sidenav](https://material.angular.io/components/sidenav/overview),  [mat-card](https://material.angular.io/components/card/overview) etc.\n\n## :floppy_disk: Setup\n\n* Install dependencies using `npm i`\n* Get yourself a free API key from `www.newsapi.org` and add it to `news-api.service.ts`\n* Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app does automatically reload if you change any of the source files.\n\n## :computer: Code Examples\n\n* `news-api.service.ts` to get API news data using Angular httpClient module.\n\n```typescript\n\nimport { Injectable } from '@angular/core';\nimport { HttpClient  } from '@angular/common/http';\n\n\n@Injectable({\n  providedIn: 'root'\n})\nexport class NewsApiService {\n\n  api_key = 'YOUR API KEY';\n\n  constructor(private http: HttpClient) { }\n  initSources() {\n     return this.http.get('https://newsapi.org/v2/sources?language=en\u0026apiKey=' + this.api_key);\n  }\n  initArticles() {\n   return this.http.get('https://newsapi.org/v2/top-headlines?sources=techcrunch\u0026apiKey=' + this.api_key);\n  }\n  getArticlesByID(source: String) {\n   return this.http.get('https://newsapi.org/v2/top-headlines?sources=' + source + '\u0026apiKey=' + this.api_key);\n  }\n}\n\n```\n\n## :cool: Features\n\n* [Angular HttpClient](https://angular.io/guide/http) module used to communicate with back-end services via the XMLHttpRequest browser interface.\n\n## :clipboard: Status \u0026 To-Do List\n\n* Status: Working.\n* To-Do: Nothing.\n\n## :clap: Inspiration\n\n* [article by Rashid Sakara on building a news application using Angular 6 and Google’s Material Design](https://www.smashingmagazine.com/2018/10/news-application-with-angular-and-material-design/)\n\n## :file_folder: License\n\n* This project is licensed under the terms of the MIT license.\n\n## :envelope: Contact\n\n* Repo created by [ABateman](https://github.com/AndrewJBateman), email: gomezbateman@yahoo.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewjbateman%2Fangular-news-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrewjbateman%2Fangular-news-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewjbateman%2Fangular-news-app/lists"}