{"id":18614980,"url":"https://github.com/andrewjbateman/ionic-angular-news","last_synced_at":"2025-04-11T00:31:02.420Z","repository":{"id":39558520,"uuid":"172350431","full_name":"AndrewJBateman/ionic-angular-news","owner":"AndrewJBateman","description":":clipboard: App to show news from an API using Angular and Ionic","archived":false,"fork":false,"pushed_at":"2023-03-04T03:12:07.000Z","size":9060,"stargazers_count":2,"open_issues_count":17,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-25T06:51:13.986Z","etag":null,"topics":["angular","angular13","api-service","html5","ionic","ionic-page","ionic6","news-api","newsapi","scss-styles"],"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}},"created_at":"2019-02-24T14:52:06.000Z","updated_at":"2022-01-22T12:40:33.000Z","dependencies_parsed_at":"2023-02-06T11:16:42.197Z","dependency_job_id":null,"html_url":"https://github.com/AndrewJBateman/ionic-angular-news","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%2Fionic-angular-news","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fionic-angular-news/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fionic-angular-news/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fionic-angular-news/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AndrewJBateman","download_url":"https://codeload.github.com/AndrewJBateman/ionic-angular-news/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248322236,"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","angular13","api-service","html5","ionic","ionic-page","ionic6","news-api","newsapi","scss-styles"],"created_at":"2024-11-07T03:27:43.333Z","updated_at":"2025-04-11T00:30:58.719Z","avatar_url":"https://github.com/AndrewJBateman.png","language":"TypeScript","readme":"# :zap: Ionic Angular News\n\n* App to search for and display news items from a [news API](https://newsapi.org/) using the [Ionic framework](https://ionicframework.com/docs).\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/ionic-angular-news?style=plastic)\n![GitHub pull requests](https://img.shields.io/github/issues-pr/AndrewJBateman/ionic-angular-news?style=plastic)\n![GitHub Repo stars](https://img.shields.io/github/stars/AndrewJBateman/ionic-angular-news?style=plastic)\n![GitHub last commit](https://img.shields.io/github/last-commit/AndrewJBateman/ionic-angular-news?style=plastic)\n\n## :page_facing_up: Table of contents\n\n* [:zap: Ionic Angular News](#zap-ionic-angular-news)\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](#clipboard-status)\n  * [:clipboard: To-do](#clipboard-to-do)\n  * [:clap: Inspiration](#clap-inspiration)\n  * [:file_folder: License](#file_folder-license)\n  * [:envelope: Contact](#envelope-contact)\n\n## :books: General info\n\n* The [News API](https://newsapi.org/) is a simple HTTP REST API for searching and retrieving live articles from the web using:\n\n1. Keyword or phrase\n2. Date published\n3. Source name\n4. Source domain name\n5. Language\n\n## :camera: Screenshots\n\n![Ionic page](./img/news-page.png)\n![Ionic page](./img/news-details.png)\n![Ionic page](./img/contact.png)\n![Ionic page](./img/about.png)\n\n## :signal_strength: Technologies\n\n* [Ionic v6](https://ionicframework.com/)\n* [Ionic/angular v6](https://www.npmjs.com/package/@ionic/angular)\n* [News REST API used to search for news articles](https://newsapi.org/) - only works in localhost. Paid subscription required if app is deployed\n\n## :floppy_disk: Setup\n\n* Add News API key to `environment.ts` - free News API will not work if deployed\n* To start the server on _localhost://8100_ type: 'ionic serve'\n\n## :computer: Code Examples\n\n* Extract from `news.service.ts` that gets data from the API.\n\n```typescript\ngetData(url: string): Observable\u003cany\u003e {\n  try {\n    return this.http\n      .get(`${apiUrl}/${url}\u0026apiKey=${apiKey}`)\n      .pipe(map((res) =\u003e res[\"articles\"]));\n  } catch (error) {\n    console.log(\"An error occured while fetching data: \", error);\n  }\n}\n```\n\n* Extract from `news.page.ts` function to get API data Observable with input url `'top-headlines?country=gb'`. Instead of using the RxJS async Observable subscribe method, the Angular async pipe now used in the template which unsubscribes itself automatically\n\n```typescript\nngOnInit(): void {\n  this.data = this.newsService.getData(\"top-headlines?country=gb\");\n}\n```\n\n## :cool: Features\n\n* Cicking on an item in the news page routes to a news detail page with more information.\n* API data service can be modified to search for news in other countries, e.g 'this.data = this.newsService.getData(\"top-headlines?country=fr\")'.\n\n## :clipboard: Status \u0026 To-do list\n\n* Status: Working.\n* To-do: This app could be improved - e.g. add newsArticle interface. An improved news app exists in [another repo](https://github.com/AndrewJBateman/ionic-angular-news-app).\n\n## :clap: Inspiration\n\n* Project initially inspired by [Baljeet Singh´s Youtube video 'Creating News Application With Ionic 4 and Angular'](https://www.youtube.com/watch?v=NJ9C7iY9350) but much improved upon. I do not recommend this video now - there are much better \u0026 more recent Ionic tutorials on Youtube - Simon Grimm or Josh Morony for example.\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","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewjbateman%2Fionic-angular-news","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrewjbateman%2Fionic-angular-news","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewjbateman%2Fionic-angular-news/lists"}