├── .gitignore ├── LICENSE ├── README.md ├── angular.json ├── e2e ├── protractor.conf.js ├── src │ ├── app.e2e-spec.ts │ └── app.po.ts └── tsconfig.e2e.json ├── img ├── detail.png └── info-search.png ├── ionic.config.json ├── package-lock.json ├── package.json ├── src ├── app │ ├── app-routing.module.ts │ ├── app.component.spec.ts │ ├── app.component.ts │ ├── app.module.ts │ ├── interfaces │ │ └── interfaces.ts │ ├── pages │ │ ├── info-details │ │ │ ├── info-details.module.ts │ │ │ ├── info-details.page.html │ │ │ ├── info-details.page.scss │ │ │ ├── info-details.page.spec.ts │ │ │ └── info-details.page.ts │ │ └── info │ │ │ ├── info.module.ts │ │ │ ├── info.page.html │ │ │ ├── info.page.scss │ │ │ ├── info.page.spec.ts │ │ │ └── info.page.ts │ └── services │ │ └── info.service.ts ├── assets │ ├── examples │ │ └── searchresult.html │ ├── icon │ │ └── favicon.png │ └── shapes.svg ├── environments │ ├── environment.prod.ts │ └── environment.ts ├── global.scss ├── index.html ├── karma.conf.js ├── main.ts ├── polyfills.ts ├── test.ts ├── theme │ └── variables.scss ├── tsconfig.app.json └── tsconfig.spec.json ├── tsconfig.json ├── tslint.json └── typings └── cordova-typings.d.ts /.gitignore: -------------------------------------------------------------------------------- 1 | /.angular/cache 2 | # Specifies intentionally untracked files to ignore when using Git 3 | # http://git-scm.com/docs/gitignore 4 | 5 | *~ 6 | *.sw[mnpcod] 7 | *.log 8 | *.tmp 9 | *.tmp.* 10 | log.txt 11 | *.sublime-project 12 | *.sublime-workspace 13 | .vscode/ 14 | npm-debug.log* 15 | 16 | .idea/ 17 | .ionic/ 18 | .sourcemaps/ 19 | .sass-cache/ 20 | .tmp/ 21 | .versions/ 22 | coverage/ 23 | www/ 24 | node_modules/ 25 | tmp/ 26 | temp/ 27 | platforms/ 28 | plugins/ 29 | plugins/android.json 30 | plugins/ios.json 31 | $RECYCLE.BIN/ 32 | 33 | .DS_Store 34 | Thumbs.db 35 | UserInterfaceState.xcuserstate 36 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Andrew Bateman 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # :zap: Ionic Angular InfoApp 2 | 3 | * App to search for info from an API and display it using the [Ionic framework](https://ionicframework.com/docs). 4 | * Uses a [movie database API](http://www.omdbapi.com/) to develop the app. 5 | * **Note:** to open web links in a new window use: _ctrl+click on link_ 6 | 7 | ![GitHub repo size](https://img.shields.io/github/repo-size/AndrewJBateman/ionic-angular-infoapp?style=plastic) 8 | ![GitHub pull requests](https://img.shields.io/github/issues-pr/AndrewJBateman/ionic-angular-infoapp?style=plastic) 9 | ![GitHub Repo stars](https://img.shields.io/github/stars/AndrewJBateman/ionic-angular-infoapp?style=plastic) 10 | ![GitHub last commit](https://img.shields.io/github/last-commit/AndrewJBateman/ionic-angular-infoapp?style=plastic) 11 | 12 | ## :page_facing_up: Table of contents 13 | 14 | * [:zap: Ionic Angular InfoApp](#zap-ionic-angular-infoapp) 15 | * [:page\_facing\_up: Table of contents](#page_facing_up-table-of-contents) 16 | * [:books: General info](#books-general-info) 17 | * [:camera: Screenshots](#camera-screenshots) 18 | * [:signal\_strength: Technologies](#signal_strength-technologies) 19 | * [:floppy\_disk: Setup](#floppy_disk-setup) 20 | * [:computer: Code Examples](#computer-code-examples) 21 | * [:cool: Features](#cool-features) 22 | * [:clipboard: Status \& To-do list](#clipboard-status--to-do-list) 23 | * [:clap: Inspiration](#clap-inspiration) 24 | * [:file\_folder: License](#file_folder-license) 25 | * [:envelope: Contact](#envelope-contact) 26 | 27 | ## :books: General info 28 | 29 | * An active search bar enables the user to search for movies, with a list of matches appearing below. Each returned movie card can be clicked on to see more details. 30 | * The API searches the [The Open Movie Database](http://www.omdbapi.com/) for search matches. 31 | 32 | ## :camera: Screenshots 33 | 34 | ![Home Page](./img/info-search.png) 35 | ![Home Page](./img/detail.png) 36 | 37 | ## :signal_strength: Technologies 38 | 39 | * [Ionic/angular v8](https://www.npmjs.com/package/@ionic/angular) 40 | * [Angular v17](https://angular.io/) dev platform 41 | * [OMDb API](http://www.omdbapi.com/) Open Movie Database, a RESTful web service 42 | * Ionic DevApp, to allow app to run on an iOS or Android device. 43 | 44 | ## :floppy_disk: Setup 45 | 46 | * Get yourself an API key from the [The Open Movie Database](https://www.omdbapi.com/) - it's free :-) 47 | * Add your movie database access credentials to `environment.ts` for dev. work 48 | * `npm i` 49 | * To start the server on _localhost://8100_ type: 'ionic serve' 50 | * The Ionic DevApp was installed on an Android device from the Google Play app store. 51 | 52 | ## :computer: Code Examples 53 | 54 | * functions to search for info and retrieve more detailed info. 55 | 56 | ```typescript 57 | // Get data from the Omdb Api 58 | // map the result to return only the results "Search" that we need 59 | // @param {string} title Search Term 60 | // @param {SearchType} type movie, series, episode or empty 61 | // @returns Observable with the search results 62 | searchData(title: string, type: SearchType): Observable { 63 | return this.http 64 | .get>( 65 | `${this.url}?&apikey=${this.apiKey}&s=${encodeURI(title)}&type=${type}` 66 | ) 67 | .pipe( 68 | map((results) => { 69 | console.log("RAW: ", results); 70 | return results["Search"]; 71 | }) 72 | ); 73 | } 74 | // Get detailed information using the "i" (not "id") parameter 75 | // @param {string} id imdbID to retrieve information 76 | // @returns Observable with detailed information 77 | getDetails(id: string): Observable { 78 | return this.http 79 | .get>( 80 | `${this.url}?i=${id}&plot=full&apikey=${this.apiKey}` 81 | ).pipe(tap(res => console.log("response: ", res))) 82 | } 83 | ``` 84 | 85 | ## :cool: Features 86 | 87 | * Working search bar 88 | * Ion icons look cool although I have made no attempt to optimise this app for a compact build file, otherwise I would replace with svg files 89 | * API response interface models added 90 | * API search function code commenting is good - I have Simon Grimm to thank for that fine example 91 | 92 | ## :clipboard: Status & To-do list 93 | 94 | * Status: Working. 95 | * To-do: Nothing 96 | 97 | ## :clap: Inspiration 98 | 99 | * Project inspired by [Simon Grimms's 'How to Build Your First Ionic 4 App with API Calls'](https://medium.freecodecamp.org/how-to-build-your-first-ionic-4-app-with-api-calls-f6ea747dc17a). 100 | 101 | ## :file_folder: License 102 | 103 | * This project is licensed under the terms of the MIT license. 104 | 105 | ## :envelope: Contact 106 | 107 | * Repo created by [ABateman](https://github.com/AndrewJBateman), email: `gomezbateman@gmail.com` 108 | -------------------------------------------------------------------------------- /angular.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular-devkit/core/src/workspace/workspace-schema.json", 3 | "version": 1, 4 | "newProjectRoot": "projects", 5 | "projects": { 6 | "app": { 7 | "root": "", 8 | "sourceRoot": "src", 9 | "projectType": "application", 10 | "prefix": "app", 11 | "schematics": {}, 12 | "architect": { 13 | "build": { 14 | "builder": "@angular-devkit/build-angular:browser", 15 | "options": { 16 | "outputPath": "www", 17 | "index": "src/index.html", 18 | "main": "src/main.ts", 19 | "polyfills": "src/polyfills.ts", 20 | "tsConfig": "src/tsconfig.app.json", 21 | "assets": [ 22 | { 23 | "glob": "**/*", 24 | "input": "src/assets", 25 | "output": "assets" 26 | }, 27 | { 28 | "glob": "**/*.svg", 29 | "input": "node_modules/ionicons/dist/ionicons/svg", 30 | "output": "./svg" 31 | } 32 | ], 33 | "styles": [ 34 | { 35 | "input": "src/theme/variables.scss" 36 | }, 37 | { 38 | "input": "src/global.scss" 39 | } 40 | ], 41 | "scripts": [], 42 | "aot": false, 43 | "vendorChunk": true, 44 | "extractLicenses": false, 45 | "buildOptimizer": false, 46 | "sourceMap": true, 47 | "optimization": false, 48 | "namedChunks": true 49 | }, 50 | "configurations": { 51 | "production": { 52 | "fileReplacements": [ 53 | { 54 | "replace": "src/environments/environment.ts", 55 | "with": "src/environments/environment.prod.ts" 56 | } 57 | ], 58 | "optimization": true, 59 | "outputHashing": "all", 60 | "sourceMap": false, 61 | "namedChunks": false, 62 | "aot": true, 63 | "extractLicenses": true, 64 | "vendorChunk": false, 65 | "buildOptimizer": true, 66 | "budgets": [ 67 | { 68 | "type": "initial", 69 | "maximumWarning": "2mb", 70 | "maximumError": "5mb" 71 | } 72 | ] 73 | }, 74 | "ci": { 75 | "progress": false 76 | } 77 | } 78 | }, 79 | "serve": { 80 | "builder": "@angular-devkit/build-angular:dev-server", 81 | "options": { 82 | "buildTarget": "app:build" 83 | }, 84 | "configurations": { 85 | "production": { 86 | "buildTarget": "app:build:production" 87 | }, 88 | "ci": { 89 | } 90 | } 91 | }, 92 | "extract-i18n": { 93 | "builder": "@angular-devkit/build-angular:extract-i18n", 94 | "options": { 95 | "buildTarget": "app:build" 96 | } 97 | }, 98 | "test": { 99 | "builder": "@angular-devkit/build-angular:karma", 100 | "options": { 101 | "main": "src/test.ts", 102 | "polyfills": "src/polyfills.ts", 103 | "tsConfig": "src/tsconfig.spec.json", 104 | "karmaConfig": "src/karma.conf.js", 105 | "styles": [], 106 | "scripts": [], 107 | "assets": [ 108 | { 109 | "glob": "favicon.ico", 110 | "input": "src/", 111 | "output": "/" 112 | }, 113 | { 114 | "glob": "**/*", 115 | "input": "src/assets", 116 | "output": "/assets" 117 | } 118 | ] 119 | }, 120 | "configurations": { 121 | "ci": { 122 | "progress": false, 123 | "watch": false 124 | } 125 | } 126 | }, 127 | "ionic-cordova-build": { 128 | "builder": "@ionic/angular-toolkit:cordova-build", 129 | "options": { 130 | "browserTarget": "app:build" 131 | }, 132 | "configurations": { 133 | "production": { 134 | "browserTarget": "app:build:production" 135 | } 136 | } 137 | }, 138 | "ionic-cordova-serve": { 139 | "builder": "@ionic/angular-toolkit:cordova-serve", 140 | "options": { 141 | "cordovaBuildTarget": "app:ionic-cordova-build", 142 | "devServerTarget": "app:serve" 143 | }, 144 | "configurations": { 145 | "production": { 146 | "cordovaBuildTarget": "app:ionic-cordova-build:production", 147 | "devServerTarget": "app:serve:production" 148 | } 149 | } 150 | } 151 | } 152 | }, 153 | "app-e2e": { 154 | "root": "e2e/", 155 | "projectType": "application", 156 | "architect": { 157 | "e2e": { 158 | "builder": "@angular-devkit/build-angular:protractor", 159 | "options": { 160 | "protractorConfig": "e2e/protractor.conf.js", 161 | "devServerTarget": "app:serve" 162 | }, 163 | "configurations": { 164 | "ci": { 165 | "devServerTarget": "app:serve:ci" 166 | } 167 | } 168 | } 169 | } 170 | } 171 | }, 172 | "cli": { 173 | "schematicCollections": [ 174 | "@ionic/angular-toolkit" 175 | ] 176 | }, 177 | "schematics": { 178 | "@ionic/angular-toolkit:component": { 179 | "styleext": "scss" 180 | }, 181 | "@ionic/angular-toolkit:page": { 182 | "styleext": "scss" 183 | } 184 | } 185 | } 186 | -------------------------------------------------------------------------------- /e2e/protractor.conf.js: -------------------------------------------------------------------------------- 1 | // Protractor configuration file, see link for more information 2 | // https://github.com/angular/protractor/blob/master/lib/config.ts 3 | 4 | const { SpecReporter } = require('jasmine-spec-reporter'); 5 | 6 | exports.config = { 7 | allScriptsTimeout: 11000, 8 | specs: [ 9 | './src/**/*.e2e-spec.ts' 10 | ], 11 | capabilities: { 12 | 'browserName': 'chrome' 13 | }, 14 | directConnect: true, 15 | baseUrl: 'http://localhost:4200/', 16 | framework: 'jasmine', 17 | jasmineNodeOpts: { 18 | showColors: true, 19 | defaultTimeoutInterval: 30000, 20 | print: function() {} 21 | }, 22 | onPrepare() { 23 | require('ts-node').register({ 24 | project: require('path').join(__dirname, './tsconfig.e2e.json') 25 | }); 26 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); 27 | } 28 | }; 29 | -------------------------------------------------------------------------------- /e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('new App', () => { 4 | let page: AppPage; 5 | 6 | beforeEach(() => { 7 | page = new AppPage(); 8 | }); 9 | 10 | it('should be blank', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toContain('The world is your oyster.'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.deepCss('app-root ion-content')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /img/detail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndrewJBateman/ionic-angular-infoapp/f364069ad6a79e69cd89e87d53fe1bf0fd0cf218/img/detail.png -------------------------------------------------------------------------------- /img/info-search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndrewJBateman/ionic-angular-infoapp/f364069ad6a79e69cd89e87d53fe1bf0fd0cf218/img/info-search.png -------------------------------------------------------------------------------- /ionic.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ionic-angular-infoApp", 3 | "integrations": {}, 4 | "type": "angular", 5 | "id": "938d7106" 6 | } 7 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ionic-angular-infoapp", 3 | "version": "1.0.0", 4 | "author": "Andrew Bateman", 5 | "homepage": "https://ionicframework.com/", 6 | "scripts": { 7 | "ng": "ng", 8 | "start": "ng serve", 9 | "build": "ng build", 10 | "test": "ng test", 11 | "lint": "ng lint", 12 | "e2e": "ng e2e" 13 | }, 14 | "private": true, 15 | "dependencies": { 16 | "@angular/common": "^17.3.8", 17 | "@angular/core": "^17.3.8", 18 | "@angular/forms": "^17.3.8", 19 | "@angular/platform-browser": "^17.3.8", 20 | "@angular/platform-browser-dynamic": "^17.3.8", 21 | "@angular/router": "^17.3.8", 22 | "@ionic-native/core": "^5.36.0", 23 | "@ionic-native/splash-screen": "^5.36.0", 24 | "@ionic-native/status-bar": "^5.36.0", 25 | "@ionic/angular": "^8.1.1", 26 | "@ionic/lab": "^3.2.15", 27 | "@ionic/pro": "2.0.4", 28 | "ajv": "^8.13.0", 29 | "core-js": "^3.37.0", 30 | "rxjs": "~7.8.1", 31 | "zone.js": "^0.14.5" 32 | }, 33 | "devDependencies": { 34 | "@angular-devkit/architect": "^0.1703.7", 35 | "@angular-devkit/build-angular": "^17.3.7", 36 | "@angular-devkit/core": "^17.3.7", 37 | "@angular-devkit/schematics": "^17.3.7", 38 | "@angular/cli": "^17.3.7", 39 | "@angular/compiler": "^17.3.8", 40 | "@angular/compiler-cli": "^17.3.8", 41 | "@angular/language-service": "^17.3.8", 42 | "@ionic/angular-toolkit": "^11.0.1", 43 | "@types/jasmine": "~5.1.4", 44 | "@types/jasminewd2": "~2.0.13", 45 | "@types/node": "~20.12.11", 46 | "codelyzer": "^6.0.2", 47 | "jasmine-core": "~5.1.2", 48 | "jasmine-spec-reporter": "~7.0.0", 49 | "karma": "~6.4.3", 50 | "karma-chrome-launcher": "~3.2.0", 51 | "karma-coverage-istanbul-reporter": "~3.0.3", 52 | "karma-jasmine": "~5.1.0", 53 | "karma-jasmine-html-reporter": "^2.1.0", 54 | "protractor": "~7.0.0", 55 | "ts-node": "~10.9.2", 56 | "tslint": "~6.1.3", 57 | "typescript": "5.4.5" 58 | }, 59 | "description": "An Ionic project" 60 | } -------------------------------------------------------------------------------- /src/app/app-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { PreloadAllModules, RouterModule, Routes } from '@angular/router'; 3 | 4 | const routes: Routes = [ 5 | { path: '', redirectTo: 'info', pathMatch: 'full' }, 6 | { path: 'info', loadChildren: () => import('./pages/info/info.module').then(m => m.InfoPageModule) }, 7 | { path: 'info/:id', loadChildren: () => import('./pages/info-details/info-details.module').then(m => m.InfoDetailsPageModule) }, 8 | ]; 9 | 10 | @NgModule({ 11 | imports: [ 12 | RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules }) 13 | ], 14 | exports: [RouterModule] 15 | }) 16 | export class AppRoutingModule { } 17 | -------------------------------------------------------------------------------- /src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; 2 | import { TestBed, async } from '@angular/core/testing'; 3 | 4 | import { Platform } from '@ionic/angular'; 5 | import { SplashScreen } from '@ionic-native/splash-screen/ngx'; 6 | import { StatusBar } from '@ionic-native/status-bar/ngx'; 7 | 8 | import { AppComponent } from './app.component'; 9 | 10 | describe('AppComponent', () => { 11 | 12 | let statusBarSpy, splashScreenSpy, platformReadySpy, platformSpy; 13 | 14 | beforeEach(async(() => { 15 | statusBarSpy = jasmine.createSpyObj('StatusBar', ['styleDefault']); 16 | splashScreenSpy = jasmine.createSpyObj('SplashScreen', ['hide']); 17 | platformReadySpy = Promise.resolve(); 18 | platformSpy = jasmine.createSpyObj('Platform', { ready: platformReadySpy }); 19 | 20 | TestBed.configureTestingModule({ 21 | declarations: [AppComponent], 22 | schemas: [CUSTOM_ELEMENTS_SCHEMA], 23 | providers: [ 24 | { provide: StatusBar, useValue: statusBarSpy }, 25 | { provide: SplashScreen, useValue: splashScreenSpy }, 26 | { provide: Platform, useValue: platformSpy }, 27 | ], 28 | }).compileComponents(); 29 | })); 30 | 31 | it('should create the app', () => { 32 | const fixture = TestBed.createComponent(AppComponent); 33 | const app = fixture.debugElement.componentInstance; 34 | expect(app).toBeTruthy(); 35 | }); 36 | 37 | it('should initialize the app', async () => { 38 | TestBed.createComponent(AppComponent); 39 | expect(platformSpy.ready).toHaveBeenCalled(); 40 | await platformReadySpy; 41 | expect(statusBarSpy.styleDefault).toHaveBeenCalled(); 42 | expect(splashScreenSpy.hide).toHaveBeenCalled(); 43 | }); 44 | 45 | // TODO: add more tests! 46 | 47 | }); 48 | -------------------------------------------------------------------------------- /src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | import { Platform } from '@ionic/angular'; 4 | import { SplashScreen } from '@ionic-native/splash-screen/ngx'; 5 | import { StatusBar } from '@ionic-native/status-bar/ngx'; 6 | 7 | @Component({ 8 | selector: 'app-root', 9 | template: ` 10 | 11 | ` 12 | }) 13 | export class AppComponent { 14 | constructor( 15 | private platform: Platform, 16 | private splashScreen: SplashScreen, 17 | private statusBar: StatusBar 18 | ) { 19 | this.initializeApp(); 20 | } 21 | 22 | initializeApp() { 23 | this.platform.ready().then(() => { 24 | this.statusBar.styleDefault(); 25 | this.splashScreen.hide(); 26 | }); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from "@angular/core"; 2 | import { BrowserModule } from "@angular/platform-browser"; 3 | import { RouteReuseStrategy } from "@angular/router"; 4 | 5 | import { IonicModule, IonicRouteStrategy } from "@ionic/angular"; 6 | import { SplashScreen } from "@ionic-native/splash-screen/ngx"; 7 | import { StatusBar } from "@ionic-native/status-bar/ngx"; 8 | 9 | import { HttpClientModule } from "@angular/common/http"; 10 | 11 | import { AppComponent } from "./app.component"; 12 | import { AppRoutingModule } from "./app-routing.module"; 13 | 14 | @NgModule({ 15 | declarations: [AppComponent], 16 | imports: [ 17 | BrowserModule, 18 | IonicModule.forRoot(), 19 | AppRoutingModule, 20 | HttpClientModule, 21 | ], 22 | providers: [ 23 | StatusBar, 24 | SplashScreen, 25 | { provide: RouteReuseStrategy, useClass: IonicRouteStrategy }, 26 | ], 27 | bootstrap: [AppComponent] 28 | }) 29 | export class AppModule {} 30 | -------------------------------------------------------------------------------- /src/app/interfaces/interfaces.ts: -------------------------------------------------------------------------------- 1 | export interface OmdbSearchResult { 2 | Title: string; 3 | Year: string; 4 | imdbID: string; 5 | Type: string; 6 | Poster: string; 7 | } 8 | 9 | export interface OmdbDetailResponse { 10 | Title: string; 11 | Year: string; 12 | Rated: string; 13 | Released: string; 14 | Runtime: string; 15 | Genre: string; 16 | Director: string; 17 | Writer: string; 18 | Actors: string; 19 | Plot: string; 20 | Language: string; 21 | Country: string; 22 | Awards: string; 23 | Poster: string; 24 | Metascore: string; 25 | imdbRating: string; 26 | imdbVotes: string; 27 | imdbID: string; 28 | Website?: string; 29 | Ratings?: OmdbRating[]; 30 | DVD?: string; 31 | BoxOffice?: string; 32 | Production?: string; 33 | Type: string; 34 | Response: 35 | string; 36 | } 37 | 38 | export interface OmdbRating { 39 | Source: string; 40 | Value: string; 41 | } -------------------------------------------------------------------------------- /src/app/pages/info-details/info-details.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | import { FormsModule } from '@angular/forms'; 4 | import { Routes, RouterModule } from '@angular/router'; 5 | 6 | import { IonicModule } from '@ionic/angular'; 7 | 8 | import { InfoDetailsPage } from './info-details.page'; 9 | 10 | const routes: Routes = [ 11 | { 12 | path: '', 13 | component: InfoDetailsPage 14 | } 15 | ]; 16 | 17 | @NgModule({ 18 | imports: [ 19 | CommonModule, 20 | FormsModule, 21 | IonicModule, 22 | RouterModule.forChild(routes) 23 | ], 24 | declarations: [InfoDetailsPage] 25 | }) 26 | export class InfoDetailsPageModule {} 27 | -------------------------------------------------------------------------------- /src/app/pages/info-details/info-details.page.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | {{ information?.Genre }} 7 | 8 | 9 | 10 | 11 | @if (information) { 12 | 13 | {{ information.Title }} 14 | 15 | {{ information.Title }} 16 | 17 | 18 | 19 | 20 | {{ information.Year }} 21 | 22 | 23 | 24 | {{ information.imdbRating }} 25 | 26 | 27 | 28 | {{ information.Director }} 29 | 30 | 31 | 32 | {{ information.Actors }} 33 | 34 | @if (information.Website && information.Website !='N/A') { 35 | 36 | 37 | Open Website 38 | 39 | } 40 | 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/app/pages/info-details/info-details.page.scss: -------------------------------------------------------------------------------- 1 | .info-img { 2 | width: 100%; 3 | height: auto; 4 | object-fit: contain; 5 | } -------------------------------------------------------------------------------- /src/app/pages/info-details/info-details.page.spec.ts: -------------------------------------------------------------------------------- 1 | import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; 2 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 3 | 4 | import { InfoDetailsPage } from './info-details.page'; 5 | 6 | describe('InfoDetailsPage', () => { 7 | let component: InfoDetailsPage; 8 | let fixture: ComponentFixture; 9 | 10 | beforeEach(async(() => { 11 | TestBed.configureTestingModule({ 12 | declarations: [ InfoDetailsPage ], 13 | schemas: [CUSTOM_ELEMENTS_SCHEMA], 14 | }) 15 | .compileComponents(); 16 | })); 17 | 18 | beforeEach(() => { 19 | fixture = TestBed.createComponent(InfoDetailsPage); 20 | component = fixture.componentInstance; 21 | fixture.detectChanges(); 22 | }); 23 | 24 | it('should create', () => { 25 | expect(component).toBeTruthy(); 26 | }); 27 | }); 28 | -------------------------------------------------------------------------------- /src/app/pages/info-details/info-details.page.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from "@angular/core"; 2 | import { ActivatedRoute } from "@angular/router"; 3 | 4 | import { InfoService } from "./../../services/info.service"; 5 | 6 | @Component({ 7 | selector: "app-info-details", 8 | templateUrl: "./info-details.page.html", 9 | styleUrls: ["./info-details.page.scss"], 10 | }) 11 | export class InfoDetailsPage implements OnInit { 12 | information = null; 13 | 14 | constructor( 15 | private activatedRoute: ActivatedRoute, 16 | private infoService: InfoService 17 | ) {} 18 | 19 | ngOnInit() { 20 | // Get the ID that was passed with the URL 21 | const id = this.activatedRoute.snapshot.paramMap.get("id"); 22 | 23 | // Get the information from the API 24 | this.infoService.getDetails(id).subscribe((result) => { 25 | this.information = result; 26 | }); 27 | } 28 | 29 | openWebsite() { 30 | window.open(this.information.Website, "_blank"); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/app/pages/info/info.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | import { FormsModule } from '@angular/forms'; 4 | import { Routes, RouterModule } from '@angular/router'; 5 | 6 | import { IonicModule } from '@ionic/angular'; 7 | 8 | import { InfoPage } from './info.page'; 9 | 10 | const routes: Routes = [ 11 | { 12 | path: '', 13 | component: InfoPage 14 | } 15 | ]; 16 | 17 | @NgModule({ 18 | imports: [ 19 | CommonModule, 20 | FormsModule, 21 | IonicModule, 22 | RouterModule.forChild(routes) 23 | ], 24 | declarations: [InfoPage] 25 | }) 26 | export class InfoPageModule {} 27 | -------------------------------------------------------------------------------- /src/app/pages/info/info.page.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | My Info Search 4 | 5 | 6 | 7 | 8 | 12 | 13 | 14 | Select Searchtype 15 | 16 | All 17 | Movie 18 | Series 19 | Episode 20 | 21 | 22 | 23 | 24 | @for (item of (results | async); track item) { 25 | 29 | 30 | @if (item.Poster != 'N/A') { 31 | {{ item.Title }} 32 | } 33 | 34 | 35 |

{{ item.Title }}

36 | {{ item.Year }} 37 |
38 | @if (item.Type == 'movie') { 39 | 43 | } 44 | @if (item.Type == 'series') { 45 | 46 | } 47 | @if (item.Type == 'game') { 48 | 52 | } 53 |
54 | } 55 |
56 |
57 | -------------------------------------------------------------------------------- /src/app/pages/info/info.page.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndrewJBateman/ionic-angular-infoapp/f364069ad6a79e69cd89e87d53fe1bf0fd0cf218/src/app/pages/info/info.page.scss -------------------------------------------------------------------------------- /src/app/pages/info/info.page.spec.ts: -------------------------------------------------------------------------------- 1 | import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; 2 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 3 | 4 | import { InfoPage } from './info.page'; 5 | 6 | describe('InfoPage', () => { 7 | let component: InfoPage; 8 | let fixture: ComponentFixture; 9 | 10 | beforeEach(async(() => { 11 | TestBed.configureTestingModule({ 12 | declarations: [ InfoPage ], 13 | schemas: [CUSTOM_ELEMENTS_SCHEMA], 14 | }) 15 | .compileComponents(); 16 | })); 17 | 18 | beforeEach(() => { 19 | fixture = TestBed.createComponent(InfoPage); 20 | component = fixture.componentInstance; 21 | fixture.detectChanges(); 22 | }); 23 | 24 | it('should create', () => { 25 | expect(component).toBeTruthy(); 26 | }); 27 | }); 28 | -------------------------------------------------------------------------------- /src/app/pages/info/info.page.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from "@angular/core"; 2 | import { Observable } from "rxjs"; 3 | 4 | import { InfoService, SearchType } from "./../../services/info.service"; 5 | 6 | @Component({ 7 | selector: "app-info", 8 | templateUrl: "./info.page.html", 9 | styleUrls: ["./info.page.scss"], 10 | }) 11 | export class InfoPage implements OnInit { 12 | results: Observable; 13 | searchTerm: ""; 14 | type: SearchType = SearchType.all; 15 | 16 | constructor(private infoService: InfoService) {} 17 | 18 | ngOnInit() {} 19 | 20 | searchChanged($event: Event): void { 21 | this.results = this.infoService.searchData(this.searchTerm, this.type); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/app/services/info.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from "@angular/core"; 2 | import { HttpClient } from "@angular/common/http"; 3 | import { Observable } from "rxjs"; 4 | import { map, tap } from "rxjs/operators"; 5 | 6 | import { OmdbSearchResult, OmdbDetailResponse } from "../interfaces/interfaces"; 7 | import { environment } from "../../environments/environment"; 8 | 9 | // Typescript custom enum for search types (optional) 10 | export enum SearchType { 11 | all = "", 12 | movie = "movie", 13 | series = "series", 14 | episode = "episode", 15 | } 16 | 17 | @Injectable({ 18 | providedIn: "root", 19 | }) 20 | export class InfoService { 21 | url = environment.API_URL; 22 | apiKey = environment.API_KEY; 23 | // Constructor of the Service with Dependency Injection 24 | // @param http The standard Angular HttpClient to make requests 25 | constructor(private http: HttpClient) {} 26 | 27 | // Get data from the Omdb Api 28 | // map the result to return only the results "Search" that we need 29 | // @param {string} title Search Term 30 | // @param {SearchType} type movie, series, episode or empty 31 | // @returns Observable with the search results 32 | searchData(title: string, type: SearchType): Observable { 33 | return this.http 34 | .get>( 35 | `${this.url}?&apikey=${this.apiKey}&s=${encodeURI(title)}&type=${type}` 36 | ) 37 | .pipe( 38 | map((results) => { 39 | console.log("RAW: ", results); 40 | return results["Search"]; 41 | }) 42 | ); 43 | } 44 | // Get detailed information using the "i" (not "id") parameter 45 | // @param {string} id imdbID to retrieve information 46 | // @returns Observable with detailed information 47 | getDetails(id: string): Observable { 48 | return this.http 49 | .get>( 50 | `${this.url}?i=${id}&plot=full&apikey=${this.apiKey}` 51 | ).pipe(tap(res => console.log("response: ", res))) 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/assets/examples/searchresult.html: -------------------------------------------------------------------------------- 1 | { 2 | "Title":"Batman", 3 | "Year":"1989", 4 | "Rated":"PG-13", 5 | "Released":"23 Jun 1989", 6 | "Runtime":"126 min", 7 | "Genre":"Action, Adventure", 8 | "Director":"Tim Burton", 9 | "Writer":"Bob Kane (Batman characters), Sam Hamm (story), Sam Hamm (screenplay), Warren Skaaren (screenplay)", 10 | "Actors":"Michael Keaton, Jack Nicholson, Kim Basinger, Robert Wuhl", 11 | "Plot":"Gotham City. Crime boss Carl Grissom (Jack Palance) effectively runs the town but there's a new crime fighter in town - Batman (Michael Keaton). Grissom's right-hand man is Jack Napier (Jack Nicholson), a brutal man who is not entirely sane... After falling out between the two Grissom has Napier set up with the Police and Napier falls to his apparent death in a vat of chemicals. However, he soon reappears as The Joker and starts a reign of terror in Gotham City. Meanwhile, reporter Vicki Vale (Kim Basinger) is in the city to do an article on Batman. She soon starts a relationship with Batman's everyday persona, billionaire Bruce Wayne.", 12 | "Language":"English, French, Spanish", 13 | "Country":"USA, UK", 14 | "Awards":"Won 1 Oscar. Another 8 wins & 26 nominations.", 15 | "Poster":"https://m.media-amazon.com/images/M/MV5BMTYwNjAyODIyMF5BMl5BanBnXkFtZTYwNDMwMDk2._V1_SX300.jpg", 16 | "Ratings": 17 | [ 18 | {"Source":"Internet Movie Database","Value":"7.5/10"}, 19 | {"Source":"Rotten Tomatoes","Value":"71%"}, 20 | {"Source":"Metacritic","Value":"69/100"} 21 | ], 22 | "Metascore":"69", 23 | "imdbRating":"7.5", 24 | "imdbVotes":"308,684", 25 | "imdbID":"tt0096895", 26 | "Type":"movie", 27 | "DVD":"25 Mar 1997", 28 | "BoxOffice":"N/A", 29 | "Production":"Warner Bros. Pictures", 30 | "Website":"N/A", 31 | "Response":"True" 32 | } -------------------------------------------------------------------------------- /src/assets/icon/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndrewJBateman/ionic-angular-infoapp/f364069ad6a79e69cd89e87d53fe1bf0fd0cf218/src/assets/icon/favicon.png -------------------------------------------------------------------------------- /src/assets/shapes.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true, 3 | API_URL: 'http://www.omdbapi.com/', 4 | API_KEY: 'f589c2db' 5 | }; 6 | -------------------------------------------------------------------------------- /src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false, 7 | API_URL: 'https://www.omdbapi.com/', 8 | API_KEY: 'YOUR API KEY HERE' 9 | }; 10 | 11 | /* 12 | * For easier debugging in development mode, you can import the following file 13 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 14 | * 15 | * This import should be commented out in production mode because it will have a negative impact 16 | * on performance if an error is thrown. 17 | */ 18 | // import 'zone.js/plugins/zone-error'; // Included with Angular CLI. 19 | -------------------------------------------------------------------------------- /src/global.scss: -------------------------------------------------------------------------------- 1 | // http://ionicframework.com/docs/theming/ 2 | @import '~@ionic/angular/css/core.css'; 3 | @import '~@ionic/angular/css/normalize.css'; 4 | @import '~@ionic/angular/css/structure.css'; 5 | @import '~@ionic/angular/css/typography.css'; 6 | @import '~@ionic/angular/css/display.css'; 7 | @import '~@ionic/angular/css/padding.css'; 8 | @import '~@ionic/angular/css/float-elements.css'; 9 | @import '~@ionic/angular/css/text-alignment.css'; 10 | @import '~@ionic/angular/css/text-transformation.css'; 11 | @import '~@ionic/angular/css/flex-utils.css'; 12 | -------------------------------------------------------------------------------- /src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Ionic App 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/1.0/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular-devkit/build-angular'], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-jasmine-html-reporter'), 12 | require('karma-coverage-istanbul-reporter'), 13 | require('@angular-devkit/build-angular/plugins/karma') 14 | ], 15 | client: { 16 | clearContext: false // leave Jasmine Spec Runner output visible in browser 17 | }, 18 | coverageIstanbulReporter: { 19 | dir: require('path').join(__dirname, '../coverage'), 20 | reports: ['html', 'lcovonly', 'text-summary'], 21 | fixWebpackSourcePaths: true 22 | }, 23 | reporters: ['progress', 'kjhtml'], 24 | port: 9876, 25 | colors: true, 26 | logLevel: config.LOG_INFO, 27 | autoWatch: true, 28 | browsers: ['Chrome'], 29 | singleRun: false 30 | }); 31 | }; 32 | -------------------------------------------------------------------------------- /src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.log(err)); 13 | -------------------------------------------------------------------------------- /src/polyfills.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This file includes polyfills needed by Angular and is loaded before the app. 3 | * You can add your own extra polyfills to this file. 4 | * 5 | * This file is divided into 2 sections: 6 | * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. 7 | * 2. Application imports. Files imported after ZoneJS that should be loaded before your main 8 | * file. 9 | * 10 | * The current setup is for so-called "evergreen" browsers; the last versions of browsers that 11 | * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), 12 | * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. 13 | * 14 | * Learn more in https://angular.io/guide/browser-support 15 | */ 16 | 17 | /*************************************************************************************************** 18 | * BROWSER POLYFILLS 19 | */ 20 | 21 | /** IE9, IE10, IE11, and Chrome <55 requires all of the following polyfills. 22 | * This also includes Android Emulators with older versions of Chrome and Google Search/Googlebot 23 | */ 24 | 25 | // import 'core-js/es6/symbol'; 26 | // import 'core-js/es6/object'; 27 | // import 'core-js/es6/function'; 28 | // import 'core-js/es6/parse-int'; 29 | // import 'core-js/es6/parse-float'; 30 | // import 'core-js/es6/number'; 31 | // import 'core-js/es6/math'; 32 | // import 'core-js/es6/string'; 33 | // import 'core-js/es6/date'; 34 | // import 'core-js/es6/array'; 35 | // import 'core-js/es6/regexp'; 36 | // import 'core-js/es6/map'; 37 | // import 'core-js/es6/weak-map'; 38 | // import 'core-js/es6/set'; 39 | 40 | /** IE10 and IE11 requires the following for the Reflect API. */ 41 | // import 'core-js/es6/reflect'; 42 | 43 | /** 44 | * By default, zone.js will patch all possible macroTask and DomEvents 45 | * user can disable parts of macroTask/DomEvents patch by setting following flags 46 | * because those flags need to be set before `zone.js` being loaded, and webpack 47 | * will put import in the top of bundle, so user need to create a separate file 48 | * in this directory (for example: zone-flags.ts), and put the following flags 49 | * into that file, and then add the following code before importing zone.js. 50 | * import './zone-flags.ts'; 51 | * 52 | * The flags allowed in zone-flags.ts are listed here. 53 | * 54 | * The following flags will work for all browsers. 55 | * 56 | * (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame 57 | * (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick 58 | * (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames 59 | * 60 | * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js 61 | * with the following flag, it will bypass `zone.js` patch for IE/Edge 62 | * 63 | * (window as any).__Zone_enable_cross_context_check = true; 64 | * 65 | */ 66 | 67 | /*************************************************************************************************** 68 | * Zone JS is required by default for Angular itself. 69 | */ 70 | import 'zone.js'; // Included with Angular CLI. 71 | 72 | 73 | /*************************************************************************************************** 74 | * APPLICATION IMPORTS 75 | */ 76 | -------------------------------------------------------------------------------- /src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | // First, initialize the Angular testing environment. 11 | getTestBed().initTestEnvironment( 12 | BrowserDynamicTestingModule, 13 | platformBrowserDynamicTesting(), { 14 | teardown: { destroyAfterEach: false } 15 | } 16 | ); 17 | -------------------------------------------------------------------------------- /src/theme/variables.scss: -------------------------------------------------------------------------------- 1 | // Ionic Variables and Theming. For more info, please see: 2 | // http://ionicframework.com/docs/theming/ 3 | 4 | /** Ionic CSS Variables **/ 5 | :root { 6 | /** primary **/ 7 | --ion-color-primary: #3880ff; 8 | --ion-color-primary-rgb: 56, 128, 255; 9 | --ion-color-primary-contrast: #ffffff; 10 | --ion-color-primary-contrast-rgb: 255, 255, 255; 11 | --ion-color-primary-shade: #3171e0; 12 | --ion-color-primary-tint: #4c8dff; 13 | 14 | /** secondary **/ 15 | --ion-color-secondary: #0cd1e8; 16 | --ion-color-secondary-rgb: 12, 209, 232; 17 | --ion-color-secondary-contrast: #ffffff; 18 | --ion-color-secondary-contrast-rgb: 255, 255, 255; 19 | --ion-color-secondary-shade: #0bb8cc; 20 | --ion-color-secondary-tint: #24d6ea; 21 | 22 | /** tertiary **/ 23 | --ion-color-tertiary: #7044ff; 24 | --ion-color-tertiary-rgb: 112, 68, 255; 25 | --ion-color-tertiary-contrast: #ffffff; 26 | --ion-color-tertiary-contrast-rgb: 255, 255, 255; 27 | --ion-color-tertiary-shade: #633ce0; 28 | --ion-color-tertiary-tint: #7e57ff; 29 | 30 | /** success **/ 31 | --ion-color-success: #10dc60; 32 | --ion-color-success-rgb: 16, 220, 96; 33 | --ion-color-success-contrast: #ffffff; 34 | --ion-color-success-contrast-rgb: 255, 255, 255; 35 | --ion-color-success-shade: #0ec254; 36 | --ion-color-success-tint: #28e070; 37 | 38 | /** warning **/ 39 | --ion-color-warning: #ffce00; 40 | --ion-color-warning-rgb: 255, 206, 0; 41 | --ion-color-warning-contrast: #ffffff; 42 | --ion-color-warning-contrast-rgb: 255, 255, 255; 43 | --ion-color-warning-shade: #e0b500; 44 | --ion-color-warning-tint: #ffd31a; 45 | 46 | /** danger **/ 47 | --ion-color-danger: #f04141; 48 | --ion-color-danger-rgb: 245, 61, 61; 49 | --ion-color-danger-contrast: #ffffff; 50 | --ion-color-danger-contrast-rgb: 255, 255, 255; 51 | --ion-color-danger-shade: #d33939; 52 | --ion-color-danger-tint: #f25454; 53 | 54 | /** dark **/ 55 | --ion-color-dark: #222428; 56 | --ion-color-dark-rgb: 34, 34, 34; 57 | --ion-color-dark-contrast: #ffffff; 58 | --ion-color-dark-contrast-rgb: 255, 255, 255; 59 | --ion-color-dark-shade: #1e2023; 60 | --ion-color-dark-tint: #383a3e; 61 | 62 | /** medium **/ 63 | --ion-color-medium: #989aa2; 64 | --ion-color-medium-rgb: 152, 154, 162; 65 | --ion-color-medium-contrast: #ffffff; 66 | --ion-color-medium-contrast-rgb: 255, 255, 255; 67 | --ion-color-medium-shade: #86888f; 68 | --ion-color-medium-tint: #a2a4ab; 69 | 70 | /** light **/ 71 | --ion-color-light: #f4f5f8; 72 | --ion-color-light-rgb: 244, 244, 244; 73 | --ion-color-light-contrast: #000000; 74 | --ion-color-light-contrast-rgb: 0, 0, 0; 75 | --ion-color-light-shade: #d7d8da; 76 | --ion-color-light-tint: #f5f6f9; 77 | } 78 | -------------------------------------------------------------------------------- /src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "types": [] 6 | }, 7 | "exclude": [ 8 | "test.ts", 9 | "**/*.spec.ts" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "types": [ 6 | "jasmine", 7 | "node" 8 | ] 9 | }, 10 | "files": [ 11 | "test.ts", 12 | "polyfills.ts" 13 | ], 14 | "include": [ 15 | "**/*.spec.ts", 16 | "**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "baseUrl": "./", 5 | "outDir": "./dist/out-tsc", 6 | "sourceMap": true, 7 | "declaration": false, 8 | "module": "esnext", 9 | "moduleResolution": "node", 10 | "emitDecoratorMetadata": true, 11 | "experimentalDecorators": true, 12 | "importHelpers": true, 13 | "target": "ES2022", 14 | "typeRoots": [ 15 | "node_modules/@types" 16 | ], 17 | "lib": [ 18 | "ES2022", 19 | "dom" 20 | ], 21 | "paths": { 22 | "core-js/es7/reflect": [ 23 | "node_modules/core-js/proposals/reflect-metadata" 24 | ], 25 | "core-js/es6/*": [ 26 | "node_modules/core-js/es/*" 27 | ] 28 | }, 29 | "useDefineForClassFields": false 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rulesDirectory": [ 3 | "codelyzer" 4 | ], 5 | "rules": { 6 | "arrow-return-shorthand": true, 7 | "callable-types": true, 8 | "class-name": true, 9 | "comment-format": [ 10 | true, 11 | "check-space" 12 | ], 13 | "curly": true, 14 | "deprecation": { 15 | "severity": "warn" 16 | }, 17 | "eofline": true, 18 | "forin": true, 19 | "import-blacklist": [ 20 | true, 21 | "rxjs/Rx" 22 | ], 23 | "import-spacing": true, 24 | "indent": [ 25 | true, 26 | "spaces" 27 | ], 28 | "interface-over-type-literal": true, 29 | "label-position": true, 30 | "max-line-length": [ 31 | true, 32 | 140 33 | ], 34 | "member-access": false, 35 | "member-ordering": [ 36 | true, 37 | { 38 | "order": [ 39 | "static-field", 40 | "instance-field", 41 | "static-method", 42 | "instance-method" 43 | ] 44 | } 45 | ], 46 | "no-arg": true, 47 | "no-bitwise": true, 48 | "no-console": [ 49 | true, 50 | "debug", 51 | "info", 52 | "time", 53 | "timeEnd", 54 | "trace" 55 | ], 56 | "no-construct": true, 57 | "no-debugger": true, 58 | "no-duplicate-super": true, 59 | "no-empty": false, 60 | "no-empty-interface": true, 61 | "no-eval": true, 62 | "no-inferrable-types": [ 63 | true, 64 | "ignore-params" 65 | ], 66 | "no-misused-new": true, 67 | "no-non-null-assertion": true, 68 | "no-redundant-jsdoc": true, 69 | "no-shadowed-variable": true, 70 | "no-string-literal": false, 71 | "no-string-throw": true, 72 | "no-switch-case-fall-through": true, 73 | "no-trailing-whitespace": true, 74 | "no-unnecessary-initializer": true, 75 | "no-unused-expression": true, 76 | "no-use-before-declare": true, 77 | "no-var-keyword": true, 78 | "object-literal-sort-keys": false, 79 | "one-line": [ 80 | true, 81 | "check-open-brace", 82 | "check-catch", 83 | "check-else", 84 | "check-whitespace" 85 | ], 86 | "prefer-const": true, 87 | "quotemark": [ 88 | true, 89 | "single" 90 | ], 91 | "radix": true, 92 | "semicolon": [ 93 | true, 94 | "always" 95 | ], 96 | "triple-equals": [ 97 | true, 98 | "allow-null-check" 99 | ], 100 | "typedef-whitespace": [ 101 | true, 102 | { 103 | "call-signature": "nospace", 104 | "index-signature": "nospace", 105 | "parameter": "nospace", 106 | "property-declaration": "nospace", 107 | "variable-declaration": "nospace" 108 | } 109 | ], 110 | "unified-signatures": true, 111 | "variable-name": false, 112 | "whitespace": [ 113 | true, 114 | "check-branch", 115 | "check-decl", 116 | "check-operator", 117 | "check-separator", 118 | "check-type" 119 | ], 120 | "no-output-on-prefix": true, 121 | "use-input-property-decorator": true, 122 | "use-output-property-decorator": true, 123 | "use-host-property-decorator": true, 124 | "no-input-rename": true, 125 | "no-output-rename": true, 126 | "use-life-cycle-interface": true, 127 | "use-pipe-transform-interface": true, 128 | "directive-class-suffix": true 129 | } 130 | } 131 | -------------------------------------------------------------------------------- /typings/cordova-typings.d.ts: -------------------------------------------------------------------------------- 1 | 2 | /// 3 | /// --------------------------------------------------------------------------------