All Projects → AndrewJBateman → ionic-angular-news-app

AndrewJBateman / ionic-angular-news-app

Licence: MIT license
📋 Ionic-Angular app to fetch news articles from a REST API using Typescript interfaces to define the expected structure of the json objects returned & http service providers. Custom pipes used to modify API news article titles, contents and convert the Universal Time Constant (UTC) date string. Dark mode, Offline Storage of favourite articles & …

Programming Languages

typescript
32286 projects
SCSS
7915 projects
HTML
75241 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to ionic-angular-news-app

Wooionic3
An eCommerce App for WooCommerce stores using Ionic 3.
Stars: ✭ 208 (+890.48%)
Mutual labels:  ionic, ionic-framework
Json2typescript
Convert JSON to TypeScript with secure type checking!
Stars: ✭ 230 (+995.24%)
Mutual labels:  ionic, ionic-framework
Ionic4 Start Theme
📱 Ionic 4 start theme (v1.0.0) with: Angular 7 + @ionic/angular 4.0.0 final+ Ionic Native 5 + Ionic CLI 4.5.0 by:
Stars: ✭ 226 (+976.19%)
Mutual labels:  ionic, ionic-framework
ionic-socialsharing-with-deeplinking-example
Ionic Social Sharing and Deep Linking example app. Complete Ionic Tutorial with free example app! Built for Ionic 3.
Stars: ✭ 16 (-23.81%)
Mutual labels:  ionic, ionic-framework
ionic-login-component
Free sample of Premium Ionic Login Component
Stars: ✭ 17 (-19.05%)
Mutual labels:  ionic, ionic-framework
Ionic Super Bar
Transparent statusBar and awesome toolBar DEMO in ionic
Stars: ✭ 180 (+757.14%)
Mutual labels:  ionic, ionic-framework
Ionic Wordpress Integration
Ionic Wordpress starter app 😎. Learn how to communicate your ionic app with Wordpress REST API with this starter and detailed tutorial.
Stars: ✭ 230 (+995.24%)
Mutual labels:  ionic, ionic-framework
Generator Jhipster Ionic
Ionic for JHipster 💥
Stars: ✭ 147 (+600%)
Mutual labels:  ionic, ionic-framework
tietracker
A simple, open source and free time tracking app ⏱️
Stars: ✭ 126 (+500%)
Mutual labels:  ionic, ionic-framework
block-photos
A photos app built with Ionic and Blockstack as backend.
Stars: ✭ 24 (+14.29%)
Mutual labels:  ionic, ionic-framework
Instaclone
Instagram clone theme for Ionic mobile apps.
Stars: ✭ 173 (+723.81%)
Mutual labels:  ionic, ionic-framework
ionic3-image-handling
In this ionic tutorial you will learn how to access the image gallery and take pictures from an ionic app. Also we will show you how to add a image cropper. This ionic tutorial includes a working ionic app example you can reuse for your needs.
Stars: ✭ 35 (+66.67%)
Mutual labels:  ionic, ionic-framework
Ionic Forms And Validations
📝 Ionic Tutorial - Learn to use Forms and Validations in Ionic Angular apps. Get a FREE Ionic 5 Forms Starter App and learn to handle simple and custom validations. Includes complete ionic forms tutorial!
Stars: ✭ 155 (+638.1%)
Mutual labels:  ionic, ionic-framework
Build A Complete Mobile App With Ionic Framework
Getting Started with Ionic Framework - Let's build a real App together! Learn the core concepts of Ionic while building a Q & A mobile app.
Stars: ✭ 188 (+795.24%)
Mutual labels:  ionic, ionic-framework
Ion Phaser
A web component to use Phaser Framework with Angular, React, Vue, etc 🎮
Stars: ✭ 152 (+623.81%)
Mutual labels:  ionic, ionic-framework
Ionic Theme Editor
A theme editor for Ionic Framework
Stars: ✭ 229 (+990.48%)
Mutual labels:  ionic, ionic-framework
Ionic Typescript Starter
📱 Platform and IDE agnostic starter project for building mobile apps with Ionic and TypeScript.
Stars: ✭ 124 (+490.48%)
Mutual labels:  ionic, ionic-framework
Ionic3 Start Theme
Ionic 3 Start Theme with 10 Pages, mock data, providers samples, Storage, Http and more...
Stars: ✭ 129 (+514.29%)
Mutual labels:  ionic, ionic-framework
google-maps-places-geolocation-for-your-ionic-app
Ionic example app of how to add Google maps, places, geolocation and related features into an Ionic Framework app.
Stars: ✭ 13 (-38.1%)
Mutual labels:  ionic, ionic-framework
ionic3
This repository contains complete source code for Ionic 3 tutorial from https://ampersandacademy.com/tutorials/ionic-framework-3. I will try many Ionic 3 specific scripts and will write them as separate tutorial. You can follow this repo to get more tested and working script for the Ionic 3.
Stars: ✭ 21 (+0%)
Mutual labels:  ionic, ionic-framework

Ionic Angular News App

  • Displays news items from a news API using the Ionic framework.
  • Note: to open web links in a new window use: ctrl+click on link

GitHub repo size GitHub pull requests GitHub Repo stars GitHub last commit

📄 Table of contents

📚 General info

  • The News API is a simple HTTP REST API for searching and retrieving live articles from the web.
  • The News API 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. This app was successfully deployed to Android Studio - see screen shots below but I deleted the firebase depoyment. I will do another news app using the Gnews API which has a free tier for up to 100 requests per day and 10 articles per search.

📷 Screenshots

Ionic page Ionic page Ionic page
News Page French News Page Spanish News Page English
Ionic page Ionic page Ionic page
News Detail Page French News Detail Page Spanish News Detail Page English
Ionic page Ionic page Ionic page
Categories Page Business Categories Page Entertainment Article Detail Page
Ionic page Ionic page Ionic page
Favourites Page Empty Favourites Page Some Favourites Page Full
Ionic page Ionic page Ionic page
About Page French About Page + Side Menu About Page + Info Menu
Ionic page Ionic page Ionic page
Dark Mode News Page Dark Mode Categories+Menu Page Dark Mode About Page
Ionic page Ionic page Ionic page
Android About Dark Page Android About Light Page Android Categories Dark Page
Ionic page Ionic page Ionic page
Android Detail Dark Page Android Detail Dark Page Android Detail Light Page
Ionic page Ionic page Ionic page
Android Favourites Light Page Android Menu Dark Page Android Menu Light Page

📶 Technologies

💾 Setup

  • It is necessary to register with news API to get an API key that is stored in the environment.ts file
  • To start the server on localhost://8100 type: ionic serve
  • To run linter: npm run lint
  • to add android platform: ionic cordova platform add android
  • to create build file for android: ionic cordova build android
  • to run on device plugged in via USB cable: ionic cordova run android
  • Follow this link to deploy to IOS or Android

💻 Code Examples

  • service to switch between dark/light display mode
// enable dark or light mode from html toggle switch event via changeThemeMode() function
export class ThemeService {
  darkMode: boolean;
  renderer: Renderer2;

  constructor(
    private rendererFactory: RendererFactory2,
    private storage: Storage,
    @Inject(DOCUMENT) private document: Document
  ) {
    this.renderer = this.rendererFactory.createRenderer(null, null);
  }

  enableDark() {
    this.renderer.addClass(this.document.body, "dark-theme");
    this.storage.set("dark-theme", true);
    this.darkMode = true;
  }

  enableLight() {
    this.renderer.removeClass(this.document.body, "dark-theme");
    this.storage.set("dark-theme", false);
    this.darkMode = false;
  }

  changeThemeMode(e: any) {
    e.detail.checked ? this.enableDark() : this.enableLight();
  }
}

🆒 Features

  • Typescript interface used to define the expected structures of the JSON objects returned from the IP and news APIs
  • Separate providers (services) page with API HTTP fetch RxJS observables
  • Custom pipes used to modify API news article titles, contents and derive '..time ago' from a date string
  • Dark mode Menu toggle changes from light to dark mode
  • Offline Storage of dark mode status & favourite articles using Ionic Storage
  • Common Refresh Component dragging down will perform refresh function
  • Common Progess Bar Component ion-card shows while news loading on News, Categories and Favourites pages
  • Localisation using i18n so user can select between English (default), Spanish and French
  • Ionic colour generator used to create color palette

📚 Navigation/Pages

  • Nav side-bar: news, categories, favorites, search, about, change language, dark theme toggle + Unsplash image with credit. Sidemenu is dismissed when the user clicks on a list item.
  • News page shows world headlines using an ion-card list. Uses *ngIf to only show card if it has an image to avoid having news items with empty spaces (API data is not perfect). Shows time as '... ago' using a date convert pipe that uses day.js to convert the API Coordinated Universal Time (UTC) date-time string to '...ago'.
  • News-detail page shows the selected news item in more detail. Title has news source end text removed using a custom Angular pipe as I show this information in the top toolbar. Also uses custom pipe to show time as '... ago'. Includes working footer buttons for 'More info', which opens news source in a separate window and 'Favourite' which adds the article to a stored news 'favourites' array. Array symbol at end of article content string replaced with text using split and concat. Remove <li> from content text using regex .
  • Categories page: ion-segment used to show categories in a scrollable horizontal menu: Sport, Busines, Health, Technology, Science, General, Entertainment. So far categories only shown from English sources. Shows time as '... ago'.
  • Favourites page: articles listed in reverse date-time order that have been saved by clicking on the favourites icon on the news-detail page. Include popover that will let user delete all list items, sliding from the right deletes the favourite, prevent storage of duplicate articles. Add 'delete all' button at top. lhs sliding delete is not working.
  • About page Displays Unsplash image with author credit and short info about the app with links to APIs used. Header includes popover with links to Author Website, Github Repo and a Contact Page.

📋 Status

  • Status: Working except storage, including language on start-up menu, production build file created, successfully deployed to Android Studio

📋 To-do

  • Fix storage
  • Disable clicking on menu icon when in news page.
  • Fix menu language storage.
  • Check image shown when API image is null, status 404 not found

👏 Inspiration

📁 License

  • This project is licensed under the terms of the MIT license.

✉️ Contact

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].