├── .gitignore ├── .vscode └── typings │ └── cordova │ └── cordova.d.ts ├── README.md ├── config.xml ├── ionic.config.json ├── package.json ├── resources ├── android │ ├── icon │ │ ├── drawable-hdpi-icon.png │ │ ├── drawable-ldpi-icon.png │ │ ├── drawable-mdpi-icon.png │ │ ├── drawable-xhdpi-icon.png │ │ ├── drawable-xxhdpi-icon.png │ │ └── drawable-xxxhdpi-icon.png │ └── splash │ │ ├── drawable-land-hdpi-screen.png │ │ ├── drawable-land-ldpi-screen.png │ │ ├── drawable-land-mdpi-screen.png │ │ ├── drawable-land-xhdpi-screen.png │ │ ├── drawable-land-xxhdpi-screen.png │ │ ├── drawable-land-xxxhdpi-screen.png │ │ ├── drawable-port-hdpi-screen.png │ │ ├── drawable-port-ldpi-screen.png │ │ ├── drawable-port-mdpi-screen.png │ │ ├── drawable-port-xhdpi-screen.png │ │ ├── drawable-port-xxhdpi-screen.png │ │ └── drawable-port-xxxhdpi-screen.png ├── icon.png ├── ios │ ├── icon │ │ ├── icon-40.png │ │ ├── icon-40@2x.png │ │ ├── icon-50.png │ │ ├── icon-50@2x.png │ │ ├── icon-60.png │ │ ├── icon-60@2x.png │ │ ├── icon-60@3x.png │ │ ├── icon-72.png │ │ ├── icon-72@2x.png │ │ ├── icon-76.png │ │ ├── icon-76@2x.png │ │ ├── icon-small.png │ │ ├── icon-small@2x.png │ │ ├── icon-small@3x.png │ │ ├── icon.png │ │ └── icon@2x.png │ └── splash │ │ ├── Default-568h@2x~iphone.png │ │ ├── Default-667h.png │ │ ├── Default-736h.png │ │ ├── Default-Landscape-736h.png │ │ ├── Default-Landscape@2x~ipad.png │ │ ├── Default-Landscape~ipad.png │ │ ├── Default-Portrait@2x~ipad.png │ │ ├── Default-Portrait~ipad.png │ │ ├── Default@2x~iphone.png │ │ └── Default~iphone.png └── splash.png ├── src ├── app │ ├── app.component.ts │ ├── app.html │ ├── app.module.ts │ ├── app.scss │ └── main.ts ├── assets │ ├── avatars │ │ ├── b_obama.jpg │ │ └── bill_clinton.jpg │ └── icon │ │ └── favicon.ico ├── declarations.d.ts ├── index.html ├── manifest.json ├── pages │ └── page1 │ │ ├── page1.html │ │ ├── page1.scss │ │ └── page1.ts ├── providers │ └── dataService.ts ├── service-worker.js └── theme │ └── variables.scss ├── tsconfig.json ├── tslint.json ├── typings └── cordova-typings.d.ts └── www ├── assets ├── avatars │ ├── b_obama.jpg │ └── bill_clinton.jpg ├── fonts │ ├── ionicons.eot │ ├── ionicons.scss │ ├── ionicons.svg │ ├── ionicons.ttf │ ├── ionicons.woff │ ├── ionicons.woff2 │ ├── noto-sans-bold.ttf │ ├── noto-sans-regular.ttf │ ├── noto-sans.scss │ ├── roboto-bold.ttf │ ├── roboto-bold.woff │ ├── roboto-light.ttf │ ├── roboto-light.woff │ ├── roboto-medium.ttf │ ├── roboto-medium.woff │ ├── roboto-regular.ttf │ ├── roboto-regular.woff │ └── roboto.scss └── icon │ └── favicon.ico ├── index.html ├── manifest.json └── service-worker.js /.gitignore: -------------------------------------------------------------------------------- 1 | # Specifies files to intentionally ignore when using Git 2 | # http://git-scm.com/docs/gitignore 3 | 4 | node_modules/ 5 | www/build/ 6 | platforms/ 7 | plugins/ 8 | *.swp 9 | .DS_Store 10 | Thumbs.db 11 | -------------------------------------------------------------------------------- /.vscode/typings/cordova/cordova.d.ts: -------------------------------------------------------------------------------- 1 | // Type definitions for Apache Cordova 2 | // Project: http://cordova.apache.org 3 | // Definitions by: Microsoft Open Technologies Inc. 4 | // Definitions: https://github.com/borisyankov/DefinitelyTyped 5 | // 6 | // Copyright (c) Microsoft Open Technologies, Inc. 7 | // Licensed under the MIT license. 8 | 9 | interface Cordova { 10 | /** Invokes native functionality by specifying corresponding service name, action and optional parameters. 11 | * @param success A success callback function. 12 | * @param fail An error callback function. 13 | * @param service The service name to call on the native side (corresponds to a native class). 14 | * @param action The action name to call on the native side (generally corresponds to the native class method). 15 | * @param args An array of arguments to pass into the native environment. 16 | */ 17 | exec(success: () => any, fail: () => any, service: string, action: string, args?: string[]): void; 18 | /** Gets the operating system name. */ 19 | platformId: string; 20 | /** Gets Cordova framework version */ 21 | version: string; 22 | /** Defines custom logic as a Cordova module. Other modules can later access it using module name provided. */ 23 | define(moduleName: string, factory: (require: any, exports: any, module: any) => any): void; 24 | /** Access a Cordova module by name. */ 25 | require(moduleName: string): any; 26 | /** Namespace for Cordova plugin functionality */ 27 | plugins:CordovaPlugins; 28 | } 29 | 30 | interface CordovaPlugins {} 31 | 32 | interface Document { 33 | addEventListener(type: "deviceready", listener: (ev: Event) => any, useCapture?: boolean): void; 34 | addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; 35 | addEventListener(type: "resume", listener: (ev: Event) => any, useCapture?: boolean): void; 36 | addEventListener(type: "backbutton", listener: (ev: Event) => any, useCapture?: boolean): void; 37 | addEventListener(type: "menubutton", listener: (ev: Event) => any, useCapture?: boolean): void; 38 | addEventListener(type: "searchbutton", listener: (ev: Event) => any, useCapture?: boolean): void; 39 | addEventListener(type: "startcallbutton", listener: (ev: Event) => any, useCapture?: boolean): void; 40 | addEventListener(type: "endcallbutton", listener: (ev: Event) => any, useCapture?: boolean): void; 41 | addEventListener(type: "volumedownbutton", listener: (ev: Event) => any, useCapture?: boolean): void; 42 | addEventListener(type: "volumeupbutton", listener: (ev: Event) => any, useCapture?: boolean): void; 43 | 44 | removeEventListener(type: "deviceready", listener: (ev: Event) => any, useCapture?: boolean): void; 45 | removeEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; 46 | removeEventListener(type: "resume", listener: (ev: Event) => any, useCapture?: boolean): void; 47 | removeEventListener(type: "backbutton", listener: (ev: Event) => any, useCapture?: boolean): void; 48 | removeEventListener(type: "menubutton", listener: (ev: Event) => any, useCapture?: boolean): void; 49 | removeEventListener(type: "searchbutton", listener: (ev: Event) => any, useCapture?: boolean): void; 50 | removeEventListener(type: "startcallbutton", listener: (ev: Event) => any, useCapture?: boolean): void; 51 | removeEventListener(type: "endcallbutton", listener: (ev: Event) => any, useCapture?: boolean): void; 52 | removeEventListener(type: "volumedownbutton", listener: (ev: Event) => any, useCapture?: boolean): void; 53 | removeEventListener(type: "volumeupbutton", listener: (ev: Event) => any, useCapture?: boolean): void; 54 | 55 | addEventListener(type: string, listener: (ev: Event) => any, useCapture?: boolean): void; 56 | removeEventListener(type: string, listener: (ev: Event) => any, useCapture?: boolean): void; 57 | } 58 | 59 | interface Window { 60 | cordova:Cordova; 61 | } 62 | 63 | // cordova/argscheck module 64 | interface ArgsCheck { 65 | checkArgs(argsSpec: string, functionName: string, args: any[], callee?: any): void; 66 | getValue(value?: any, defaultValue?: any): any; 67 | enableChecks: boolean; 68 | } 69 | 70 | // cordova/urlutil module 71 | interface UrlUtil { 72 | makeAbsolute(url: string): string 73 | } 74 | 75 | /** Apache Cordova instance */ 76 | declare var cordova: Cordova; 77 | 78 | declare module 'cordova' { 79 | export = cordova; 80 | } 81 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Ionic2-NutritionSample 2 | 3 | This is a sample application based on off a Ionic2 to show the use of http in an application. 4 | 5 | ### YouTube Channel 6 | -- 7 | #### [Check out the videos and leave suggestions for new ones and subscribe for updates](https://www.youtube.com/c/AaronSaundersCI) 8 | -- 9 | 10 | In this example, we are using https://developer.nutritionix.com/for nutrition information; showing how to access REST API using ngFor directive for rendering the data. 11 | 12 | ####Ionic Version Information 13 | ``` 14 | Cordova CLI: 6.4.0 15 | Ionic Framework Version: 2.0.0 16 | Ionic CLI Version: 2.2.1 17 | Ionic App Lib Version: 2.1.7 18 | Ionic App Scripts Version: 1.0.0 19 | ios-deploy version: 1.9.1 20 | ios-sim version: 5.0.6 21 | OS: macOS Sierra 22 | Node Version: v5.0.0 23 | Xcode version: Xcode 8.2.1 Build version 8C1002 24 | ``` 25 | 26 | ####Function in service to query REST API 27 | ```javascript 28 | getSearchResults(_searchString) { 29 | 30 | // fields to get back from API based on documenation 31 | let fields = 'brand_id,item_name,item_id,brand_name,nf_calories,nf_total_fat'; 32 | 33 | // set the parameters for the http request, these will be 34 | // added to the query string 35 | let params: URLSearchParams = new URLSearchParams(); 36 | params.set('appId', this.APP_ID); 37 | params.set('appKey', this.API_KEY); 38 | params.set('fields', fields) 39 | 40 | // construct the URL, adding the search term to the url 41 | let url = this.BASE_URL + _searchString 42 | 43 | // execute the http get request, passing in query tring parameters 44 | // use the .map() to convert results to JSON to be returned to 45 | // the caller 46 | return this.http.get(url, { search: params }) 47 | .map(res => res.json()) 48 | 49 | } 50 | ``` 51 | 52 | ####Use the service to get the data 53 | ```javascript 54 | // have a string, do the search 55 | this._dataService.getSearchResults(q) 56 | .subscribe( 57 | // process the results.. 58 | (data) => { 59 | console.log('search results', data.hits) 60 | this.items = data.hits 61 | }, 62 | // handle an error condition... 63 | (err) => alert("Error Searching: " + err), 64 | // called when completely done processing 65 | () => { console.log("All Good With The Data") } 66 | ); 67 | ``` 68 | ##MORE IONIC2 SAMPLES HERE 69 | - [https://github.com/aaronksaunders/ionic2-firebase-sample](https://github.com/aaronksaunders/ionic2-firebase-sample) 70 | - [https://github.com/aaronksaunders/ionic2-angularfire-sample](https://github.com/aaronksaunders/ionic2-angularfire-sample) 71 | - [https://github.com/aaronksaunders/kinvey-starter-ionic2](https://github.com/aaronksaunders/kinvey-starter-ionic2) 72 | - [https://github.com/aaronksaunders/Ionic2-NutritionSample](https://github.com/aaronksaunders/Ionic2-NutritionSample) 73 | -------------------------------------------------------------------------------- /config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | ionic2http 4 | An Ionic Framework and Cordova project. 5 | Ionic Framework Team 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /ionic.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ionic2http", 3 | "app_id": "", 4 | "v2": true, 5 | "typescript": true 6 | } 7 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ionic2http", 3 | "author": "Ionic Framework", 4 | "homepage": "http://ionicframework.com/", 5 | "private": true, 6 | "scripts": { 7 | "clean": "ionic-app-scripts clean", 8 | "build": "ionic-app-scripts build", 9 | "ionic:build": "ionic-app-scripts build", 10 | "ionic:serve": "ionic-app-scripts serve" 11 | }, 12 | "dependencies": { 13 | "@angular/common": "2.2.1", 14 | "@angular/compiler": "2.2.1", 15 | "@angular/compiler-cli": "2.2.1", 16 | "@angular/core": "2.2.1", 17 | "@angular/forms": "2.2.1", 18 | "@angular/http": "2.2.1", 19 | "@angular/platform-browser": "2.2.1", 20 | "@angular/platform-browser-dynamic": "2.2.1", 21 | "@angular/platform-server": "2.2.1", 22 | "@ionic/storage": "1.1.7", 23 | "ionic-angular": "2.0.0", 24 | "ionic-native": "2.4.1", 25 | "ionicons": "3.0.0", 26 | "rxjs": "5.0.0-beta.12", 27 | "zone.js": "0.6.26", 28 | "sw-toolbox": "3.4.0" 29 | }, 30 | "devDependencies": { 31 | "@ionic/app-scripts": "1.0.0", 32 | "typescript": "2.0.9" 33 | }, 34 | "cordovaPlugins": [ 35 | "ionic-plugin-keyboard", 36 | "cordova-plugin-whitelist", 37 | "cordova-plugin-console", 38 | "cordova-plugin-statusbar", 39 | "cordova-plugin-device", 40 | "cordova-plugin-splashscreen", 41 | "cordova-plugin-media-capture", 42 | "cordova-plugin-file", 43 | "cordova-plugin-compat", 44 | "cordova-plugin-photokandy-video-thumbnail", 45 | "cordova-plugin-x-toast", 46 | "cordova-plugin-geolocation", 47 | { 48 | "id": "cordova-plugin-facebook4", 49 | "locator": "cordova-plugin-facebook4", 50 | "variables": { 51 | "APP_ID": "744729192349305", 52 | "APP_NAME": "phencedApp" 53 | } 54 | }, 55 | "cordova-plugin-inappbrowser", 56 | "cordova-plugin-contacts", 57 | "cordova-plugin-googlemaps", 58 | { 59 | "locator": "https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk", 60 | "id": "com.googlemaps.ios" 61 | }, 62 | "cordova-plugin-camera" 63 | ], 64 | "cordovaPlatforms": [ 65 | "ios", 66 | { 67 | "platform": "ios", 68 | "version": "", 69 | "locator": "ios" 70 | }, 71 | { 72 | "platform": "android", 73 | "version": "", 74 | "locator": "android" 75 | } 76 | ], 77 | "description": "ionic2http: An Ionic project" 78 | } 79 | -------------------------------------------------------------------------------- /resources/android/icon/drawable-hdpi-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/resources/android/icon/drawable-hdpi-icon.png -------------------------------------------------------------------------------- /resources/android/icon/drawable-ldpi-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/resources/android/icon/drawable-ldpi-icon.png -------------------------------------------------------------------------------- /resources/android/icon/drawable-mdpi-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/resources/android/icon/drawable-mdpi-icon.png -------------------------------------------------------------------------------- /resources/android/icon/drawable-xhdpi-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/resources/android/icon/drawable-xhdpi-icon.png -------------------------------------------------------------------------------- /resources/android/icon/drawable-xxhdpi-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/resources/android/icon/drawable-xxhdpi-icon.png -------------------------------------------------------------------------------- /resources/android/icon/drawable-xxxhdpi-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/resources/android/icon/drawable-xxxhdpi-icon.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-land-hdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/resources/android/splash/drawable-land-hdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-land-ldpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/resources/android/splash/drawable-land-ldpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-land-mdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/resources/android/splash/drawable-land-mdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-land-xhdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/resources/android/splash/drawable-land-xhdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-land-xxhdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/resources/android/splash/drawable-land-xxhdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-land-xxxhdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/resources/android/splash/drawable-land-xxxhdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-port-hdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/resources/android/splash/drawable-port-hdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-port-ldpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/resources/android/splash/drawable-port-ldpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-port-mdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/resources/android/splash/drawable-port-mdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-port-xhdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/resources/android/splash/drawable-port-xhdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-port-xxhdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/resources/android/splash/drawable-port-xxhdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-port-xxxhdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/resources/android/splash/drawable-port-xxxhdpi-screen.png -------------------------------------------------------------------------------- /resources/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/resources/icon.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/resources/ios/icon/icon-40.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/resources/ios/icon/icon-40@2x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/resources/ios/icon/icon-50.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-50@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/resources/ios/icon/icon-50@2x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/resources/ios/icon/icon-60.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/resources/ios/icon/icon-60@2x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/resources/ios/icon/icon-60@3x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/resources/ios/icon/icon-72.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-72@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/resources/ios/icon/icon-72@2x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/resources/ios/icon/icon-76.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/resources/ios/icon/icon-76@2x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/resources/ios/icon/icon-small.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-small@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/resources/ios/icon/icon-small@2x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-small@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/resources/ios/icon/icon-small@3x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/resources/ios/icon/icon.png -------------------------------------------------------------------------------- /resources/ios/icon/icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/resources/ios/icon/icon@2x.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-568h@2x~iphone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/resources/ios/splash/Default-568h@2x~iphone.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-667h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/resources/ios/splash/Default-667h.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-736h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/resources/ios/splash/Default-736h.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-Landscape-736h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/resources/ios/splash/Default-Landscape-736h.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-Landscape@2x~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/resources/ios/splash/Default-Landscape@2x~ipad.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-Landscape~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/resources/ios/splash/Default-Landscape~ipad.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-Portrait@2x~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/resources/ios/splash/Default-Portrait@2x~ipad.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-Portrait~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/resources/ios/splash/Default-Portrait~ipad.png -------------------------------------------------------------------------------- /resources/ios/splash/Default@2x~iphone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/resources/ios/splash/Default@2x~iphone.png -------------------------------------------------------------------------------- /resources/ios/splash/Default~iphone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/resources/ios/splash/Default~iphone.png -------------------------------------------------------------------------------- /resources/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/resources/splash.png -------------------------------------------------------------------------------- /src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Page1 } from './../pages/page1/page1'; 2 | 3 | import { Component, ViewChild } from '@angular/core'; 4 | import { Nav, Platform } from 'ionic-angular'; 5 | import { StatusBar, Splashscreen } from 'ionic-native'; 6 | 7 | 8 | 9 | 10 | @Component({ 11 | templateUrl: 'app.html' 12 | }) 13 | 14 | export class MyApp { 15 | @ViewChild(Nav) nav: Nav; 16 | rootPage: any = Page1; 17 | pages; 18 | lastPage 19 | 20 | constructor(platform: Platform) { 21 | platform.ready().then(() => { 22 | // Okay, so the platform is ready and our plugins are available. 23 | // Here you can do any higher level native things you might need. 24 | StatusBar.styleDefault(); 25 | Splashscreen.hide(); 26 | }); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/app/app.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { Page1 } from './../pages/page1/page1'; 2 | import { DataService } from './../providers/dataService'; 3 | import { IonicApp, IonicModule, IonicErrorHandler } from 'ionic-angular'; 4 | 5 | 6 | import { NgModule, ErrorHandler } from '@angular/core'; 7 | import { MyApp } from './app.component'; 8 | 9 | 10 | 11 | @NgModule({ 12 | declarations: [ 13 | MyApp, 14 | Page1 15 | ], 16 | imports: [ 17 | IonicModule.forRoot(MyApp) 18 | ], 19 | bootstrap: [IonicApp], 20 | entryComponents: [ 21 | MyApp, 22 | Page1 23 | ], 24 | providers: [ DataService, { provide: ErrorHandler, useClass: IonicErrorHandler } 25 | ] 26 | }) 27 | export class AppModule { } 28 | -------------------------------------------------------------------------------- /src/app/app.scss: -------------------------------------------------------------------------------- 1 | // http://ionicframework.com/docs/v2/theming/ 2 | 3 | 4 | // App Global Sass 5 | // -------------------------------------------------- 6 | // Put style rules here that you want to apply globally. These 7 | // styles are for the entire app and not just one component. 8 | // Additionally, this file can be also used as an entry point 9 | // to import other Sass files to be included in the output CSS. 10 | // 11 | // Shared Sass variables, which can be used to adjust Ionic's 12 | // default Sass variables, belong in "theme/variables.scss". 13 | // 14 | // To declare rules for a specific mode, create a child rule 15 | // for the .md, .ios, or .wp mode classes. The mode class is 16 | // automatically applied to the element in the app. 17 | 18 | ion-app._gmaps_cdv_ .nav-decor{ 19 | background-color: transparent !important; 20 | } -------------------------------------------------------------------------------- /src/app/main.ts: -------------------------------------------------------------------------------- 1 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 2 | 3 | import { AppModule } from './app.module'; 4 | 5 | platformBrowserDynamic().bootstrapModule(AppModule); 6 | -------------------------------------------------------------------------------- /src/assets/avatars/b_obama.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/src/assets/avatars/b_obama.jpg -------------------------------------------------------------------------------- /src/assets/avatars/bill_clinton.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/src/assets/avatars/bill_clinton.jpg -------------------------------------------------------------------------------- /src/assets/icon/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/src/assets/icon/favicon.ico -------------------------------------------------------------------------------- /src/declarations.d.ts: -------------------------------------------------------------------------------- 1 | /* 2 | Declaration files are how the Typescript compiler knows about the type information(or shape) of an object. 3 | They're what make intellisense work and make Typescript know all about your code. 4 | 5 | A wildcard module is declared below to allow third party libraries to be used in an app even if they don't 6 | provide their own type declarations. 7 | 8 | To learn more about using third party libraries in an Ionic app, check out the docs here: 9 | http://ionicframework.com/docs/v2/resources/third-party-libs/ 10 | 11 | For more info on type definition files, check out the Typescript docs here: 12 | https://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html 13 | */ 14 | declare module '*'; -------------------------------------------------------------------------------- /src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Ionic App 7 | 8 | 9 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /src/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Ionic", 3 | "short_name": "Ionic", 4 | "start_url": "index.html", 5 | "display": "standalone", 6 | "icons": [{ 7 | "src": "assets/imgs/logo.png", 8 | "sizes": "512x512", 9 | "type": "image/png" 10 | }], 11 | "background_color": "#4e8ef7", 12 | "theme_color": "#4e8ef7" 13 | } -------------------------------------------------------------------------------- /src/pages/page1/page1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Nutrition Test v2 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

MY PAGE

13 | 14 | 15 | {{item.fields.brand_name}} - {{item.fields.item_name}} - Calories: {{item.fields.nf_calories}} 16 | 17 | 18 |
-------------------------------------------------------------------------------- /src/pages/page1/page1.scss: -------------------------------------------------------------------------------- 1 | .page1 { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /src/pages/page1/page1.ts: -------------------------------------------------------------------------------- 1 | import { DataService } from './../../providers/dataService'; 2 | import { LoadingController, NavController} from 'ionic-angular'; 3 | import { 4 | OnInit, 5 | OnDestroy, 6 | Component 7 | } from '@angular/core'; 8 | 9 | 10 | @Component({ 11 | templateUrl: 'page1.html', 12 | }) 13 | export class Page1 implements OnInit, OnDestroy { 14 | 15 | // the first page of the app 16 | rootPage: any = Page1; 17 | 18 | // the array of items found 19 | items 20 | 21 | // the search string 22 | searchQuery 23 | 24 | constructor(private _dataService: DataService, 25 | private _loadingCtrl : LoadingController, 26 | private _nav: NavController) { 27 | 28 | // be sure to initizalize the model objects to avoid 29 | // weird errors in the console 30 | 31 | // the array of items found 32 | this.items = []; 33 | 34 | // the search string 35 | this.searchQuery = "" 36 | } 37 | 38 | /** 39 | * do any initialization here NOT in the constructor 40 | */ 41 | ngOnInit() { 42 | console.log('onInit'); 43 | } 44 | 45 | ngOnDestroy() { 46 | console.log('onDestroy'); 47 | } 48 | 49 | /** 50 | * query the API with the specific search string 51 | */ 52 | getItems() { 53 | // clean up the string, if empty then exit 54 | let q = this.searchQuery.trim() 55 | if (q == '' || q.length < 3) { 56 | return; 57 | } 58 | 59 | let loading = this._loadingCtrl.create({ 60 | content: 'Searching, Please Wait...' 61 | }); 62 | loading.present(); 63 | 64 | 65 | // have a string, do the search 66 | this._dataService.getSearchResults(q) 67 | .subscribe( 68 | // process the results.. 69 | (data) => { 70 | console.log('search results', data.hits) 71 | this.items = data.hits 72 | }, 73 | // handle an error condition... 74 | (err) => alert("Error Searching: " + err), 75 | // called when completely done processing 76 | () => { 77 | console.log("All Good With The Data"); 78 | loading.dismiss() 79 | } 80 | ); 81 | } 82 | 83 | 84 | } 85 | -------------------------------------------------------------------------------- /src/providers/dataService.ts: -------------------------------------------------------------------------------- 1 | import {Injectable} from '@angular/core'; 2 | import {Http, Response, URLSearchParams} from '@angular/http'; 3 | // Add all operators to Observable, needed for adding 4 | // .map() on to the end of the http request 5 | import 'rxjs/Rx'; 6 | 7 | 8 | // allow this service to be injected into other components 9 | @Injectable() 10 | export class DataService { 11 | 12 | // set URL for API 13 | private BASE_URL = 'https://api.nutritionix.com/v1_1/search/'; // URL to web api 14 | private APP_ID = '8abbcd8e' 15 | private API_KEY = '36e8d264537037ee7e832a41902ffe57' 16 | constructor(private http: Http) { } 17 | /** 18 | * 19 | */ 20 | getSearchResults(_searchString) { 21 | 22 | // fields to get back from API based on documenation 23 | let fields = 'brand_id,item_name,item_id,brand_name,nf_calories,nf_total_fat'; 24 | 25 | // set the parameters for the http request, these will be 26 | // added to the query string 27 | let params: URLSearchParams = new URLSearchParams(); 28 | params.set('results', '0:50') 29 | params.set('appId', this.APP_ID); 30 | params.set('appKey', this.API_KEY); 31 | params.set('fields', fields) 32 | 33 | // construct the URL, adding the search term to the url 34 | let url = this.BASE_URL + _searchString 35 | 36 | // execute the http get request, passing in query tring parameters 37 | // use the .map() to convert results to JSON to be returned to 38 | // the caller 39 | return this.http.get(url, { search: params }) 40 | .map(res => res.json()) 41 | 42 | } 43 | 44 | } -------------------------------------------------------------------------------- /src/service-worker.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Check out https://googlechrome.github.io/sw-toolbox/docs/master/index.html for 3 | * more info on how to use sw-toolbox to custom configure your service worker. 4 | */ 5 | 6 | 7 | 'use strict'; 8 | importScripts('./build/sw-toolbox.js'); 9 | 10 | self.toolbox.options.cache = { 11 | name: 'ionic-cache' 12 | }; 13 | 14 | // pre-cache our key assets 15 | self.toolbox.precache( 16 | [ 17 | './build/main.js', 18 | './build/main.css', 19 | './build/polyfills.js', 20 | 'index.html', 21 | 'manifest.json' 22 | ] 23 | ); 24 | 25 | // dynamically cache any other local assets 26 | self.toolbox.router.any('/*', self.toolbox.cacheFirst); 27 | 28 | // for any other requests go to the network, cache, 29 | // and then only use that cached resource if your user goes offline 30 | self.toolbox.router.default = self.toolbox.networkFirst; -------------------------------------------------------------------------------- /src/theme/variables.scss: -------------------------------------------------------------------------------- 1 | // Ionic Variables and Theming. For more info, please see: 2 | // http://ionicframework.com/docs/v2/theming/ 3 | $font-path: "../assets/fonts"; 4 | 5 | @import "ionic.globals"; 6 | 7 | 8 | // Shared Variables 9 | // -------------------------------------------------- 10 | // To customize the look and feel of this app, you can override 11 | // the Sass variables found in Ionic's source scss files. 12 | // To view all the possible Ionic variables, see: 13 | // http://ionicframework.com/docs/v2/theming/overriding-ionic-variables/ 14 | 15 | 16 | 17 | 18 | // Named Color Variables 19 | // -------------------------------------------------- 20 | // Named colors makes it easy to reuse colors on various components. 21 | // It's highly recommended to change the default colors 22 | // to match your app's branding. Ionic uses a Sass map of 23 | // colors so you can add, rename and remove colors as needed. 24 | // The "primary" color is the only required color in the map. 25 | 26 | $colors: ( 27 | primary: #387ef5, 28 | secondary: #32db64, 29 | danger: #f53d3d, 30 | light: #f4f4f4, 31 | dark: #222 32 | ); 33 | 34 | 35 | // App iOS Variables 36 | // -------------------------------------------------- 37 | // iOS only Sass variables can go here 38 | 39 | 40 | 41 | 42 | // App Material Design Variables 43 | // -------------------------------------------------- 44 | // Material Design only Sass variables can go here 45 | 46 | 47 | 48 | 49 | // App Windows Variables 50 | // -------------------------------------------------- 51 | // Windows only Sass variables can go here 52 | 53 | 54 | 55 | 56 | // App Theme 57 | // -------------------------------------------------- 58 | // Ionic apps can have different themes applied, which can 59 | // then be future customized. This import comes last 60 | // so that the above variables are used and Ionic's 61 | // default are overridden. 62 | 63 | @import "ionic.theme.default"; 64 | 65 | 66 | // Ionicons 67 | // -------------------------------------------------- 68 | // The premium icon font for Ionic. For more info, please see: 69 | // http://ionicframework.com/docs/v2/ionicons/ 70 | 71 | @import "ionicons"; 72 | 73 | 74 | // Fonts 75 | // -------------------------------------------------- 76 | 77 | @import "roboto"; 78 | @import "noto-sans"; 79 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "allowSyntheticDefaultImports": true, 4 | "declaration": false, 5 | "emitDecoratorMetadata": true, 6 | "experimentalDecorators": true, 7 | "lib": [ 8 | "dom", 9 | "es2015" 10 | ], 11 | "module": "es2015", 12 | "moduleResolution": "node", 13 | "sourceMap": true, 14 | "target": "es5" 15 | }, 16 | "include": [ 17 | "src/**/*.ts" 18 | ], 19 | "exclude": [ 20 | "node_modules" 21 | ], 22 | "compileOnSave": false, 23 | "atom": { 24 | "rewriteTsconfig": false 25 | } 26 | } -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | "no-duplicate-variable": true, 4 | "no-unused-variable": [ 5 | true 6 | ] 7 | }, 8 | "rulesDirectory": [ 9 | "node_modules/tslint-eslint-rules/dist/rules" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /typings/cordova-typings.d.ts: -------------------------------------------------------------------------------- 1 | 2 | /// 3 | /// 4 | /// -------------------------------------------------------------------------------- /www/assets/avatars/b_obama.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/www/assets/avatars/b_obama.jpg -------------------------------------------------------------------------------- /www/assets/avatars/bill_clinton.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/www/assets/avatars/bill_clinton.jpg -------------------------------------------------------------------------------- /www/assets/fonts/ionicons.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/www/assets/fonts/ionicons.eot -------------------------------------------------------------------------------- /www/assets/fonts/ionicons.scss: -------------------------------------------------------------------------------- 1 | 2 | // Ionicons Icon Font CSS 3 | // -------------------------- 4 | // Ionicons CSS for Ionic's element 5 | // ionicons-icons.scss has the icons and their unicode characters 6 | 7 | $ionicons-font-path: $font-path !default; 8 | 9 | @import "ionicons-icons"; 10 | @import "ionicons-variables"; 11 | 12 | 13 | @font-face { 14 | font-family: "Ionicons"; 15 | src: url("#{$ionicons-font-path}/ionicons.woff2?v=#{$ionicons-version}") format("woff2"), 16 | url("#{$ionicons-font-path}/ionicons.woff?v=#{$ionicons-version}") format("woff"), 17 | url("#{$ionicons-font-path}/ionicons.ttf?v=#{$ionicons-version}") format("truetype"); 18 | font-weight: normal; 19 | font-style: normal; 20 | } 21 | 22 | ion-icon { 23 | display: inline-block; 24 | 25 | font-family: "Ionicons"; 26 | -moz-osx-font-smoothing: grayscale; 27 | -webkit-font-smoothing: antialiased; 28 | font-style: normal; 29 | font-variant: normal; 30 | font-weight: normal; 31 | line-height: 1; 32 | text-rendering: auto; 33 | text-transform: none; 34 | speak: none; 35 | } 36 | -------------------------------------------------------------------------------- /www/assets/fonts/ionicons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/www/assets/fonts/ionicons.ttf -------------------------------------------------------------------------------- /www/assets/fonts/ionicons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/www/assets/fonts/ionicons.woff -------------------------------------------------------------------------------- /www/assets/fonts/ionicons.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/www/assets/fonts/ionicons.woff2 -------------------------------------------------------------------------------- /www/assets/fonts/noto-sans-bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/www/assets/fonts/noto-sans-bold.ttf -------------------------------------------------------------------------------- /www/assets/fonts/noto-sans-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/www/assets/fonts/noto-sans-regular.ttf -------------------------------------------------------------------------------- /www/assets/fonts/noto-sans.scss: -------------------------------------------------------------------------------- 1 | // Noto Sans Font 2 | // Google 3 | // Apache License, version 2.0 4 | // http://www.apache.org/licenses/LICENSE-2.0.html 5 | 6 | $noto-sans-font-path: $font-path !default; 7 | 8 | @font-face { 9 | font-family: "Noto Sans"; 10 | font-style: normal; 11 | font-weight: 300; 12 | src: local("Noto Sans"), local("Noto-Sans-Regular"), url("#{$noto-sans-font-path}/noto-sans-regular.ttf") format("truetype"); 13 | } 14 | 15 | @font-face { 16 | font-family: "Noto Sans"; 17 | font-style: normal; 18 | font-weight: 400; 19 | src: local("Noto Sans"), local("Noto-Sans-Regular"), url("#{$noto-sans-font-path}/noto-sans-regular.ttf") format("truetype"); 20 | } 21 | 22 | @font-face { 23 | font-family: "Noto Sans"; 24 | font-style: normal; 25 | font-weight: 500; 26 | src: local("Noto Sans Bold"), local("Noto-Sans-Bold"), url("#{$noto-sans-font-path}/noto-sans-bold.ttf") format("truetype"); 27 | } 28 | 29 | @font-face { 30 | font-family: "Noto Sans"; 31 | font-style: normal; 32 | font-weight: 700; 33 | src: local("Noto Sans Bold"), local("Noto-Sans-Bold"), url("#{$noto-sans-font-path}/noto-sans-bold.ttf") format("truetype"); 34 | } 35 | -------------------------------------------------------------------------------- /www/assets/fonts/roboto-bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/www/assets/fonts/roboto-bold.ttf -------------------------------------------------------------------------------- /www/assets/fonts/roboto-bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/www/assets/fonts/roboto-bold.woff -------------------------------------------------------------------------------- /www/assets/fonts/roboto-light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/www/assets/fonts/roboto-light.ttf -------------------------------------------------------------------------------- /www/assets/fonts/roboto-light.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/www/assets/fonts/roboto-light.woff -------------------------------------------------------------------------------- /www/assets/fonts/roboto-medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/www/assets/fonts/roboto-medium.ttf -------------------------------------------------------------------------------- /www/assets/fonts/roboto-medium.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/www/assets/fonts/roboto-medium.woff -------------------------------------------------------------------------------- /www/assets/fonts/roboto-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/www/assets/fonts/roboto-regular.ttf -------------------------------------------------------------------------------- /www/assets/fonts/roboto-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/www/assets/fonts/roboto-regular.woff -------------------------------------------------------------------------------- /www/assets/fonts/roboto.scss: -------------------------------------------------------------------------------- 1 | // Roboto Font 2 | // Google 3 | // Apache License, version 2.0 4 | // http://www.apache.org/licenses/LICENSE-2.0.html 5 | 6 | $roboto-font-path: $font-path !default; 7 | 8 | @font-face { 9 | font-family: "Roboto"; 10 | font-style: normal; 11 | font-weight: 300; 12 | src: local("Roboto Light"), local("Roboto-Light"), url("#{$roboto-font-path}/roboto-light.ttf") format("truetype"), url("#{$roboto-font-path}/roboto-light.woff") format("woff"); 13 | } 14 | 15 | @font-face { 16 | font-family: "Roboto"; 17 | font-style: normal; 18 | font-weight: 400; 19 | src: local("Roboto"), local("Roboto-Regular"), url("#{$roboto-font-path}/roboto-regular.ttf") format("truetype"), url("#{$roboto-font-path}/roboto-regular.woff") format("woff"); 20 | } 21 | 22 | @font-face { 23 | font-family: "Roboto"; 24 | font-style: normal; 25 | font-weight: 500; 26 | src: local("Roboto Medium"), local("Roboto-Medium"), url("#{$roboto-font-path}/roboto-medium.ttf") format("truetype"), url("#{$roboto-font-path}/roboto-medium.woff") format("woff"); 27 | } 28 | 29 | @font-face { 30 | font-family: "Roboto"; 31 | font-style: normal; 32 | font-weight: 700; 33 | src: local("Roboto Bold"), local("Roboto-Bold"), url("#{$roboto-font-path}/roboto-bold.ttf") format("truetype"), url("#{$roboto-font-path}/roboto-bold.woff") format("woff"); 34 | } 35 | -------------------------------------------------------------------------------- /www/assets/icon/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/Ionic2-NutritionSample/04cb894c89ab9cc3f40e5afad7135c2a3a914f31/www/assets/icon/favicon.ico -------------------------------------------------------------------------------- /www/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Ionic App 7 | 8 | 9 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /www/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Ionic", 3 | "short_name": "Ionic", 4 | "start_url": "index.html", 5 | "display": "standalone", 6 | "icons": [{ 7 | "src": "assets/imgs/logo.png", 8 | "sizes": "512x512", 9 | "type": "image/png" 10 | }], 11 | "background_color": "#4e8ef7", 12 | "theme_color": "#4e8ef7" 13 | } -------------------------------------------------------------------------------- /www/service-worker.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Check out https://googlechrome.github.io/sw-toolbox/docs/master/index.html for 3 | * more info on how to use sw-toolbox to custom configure your service worker. 4 | */ 5 | 6 | 7 | 'use strict'; 8 | importScripts('./build/sw-toolbox.js'); 9 | 10 | self.toolbox.options.cache = { 11 | name: 'ionic-cache' 12 | }; 13 | 14 | // pre-cache our key assets 15 | self.toolbox.precache( 16 | [ 17 | './build/main.js', 18 | './build/main.css', 19 | './build/polyfills.js', 20 | 'index.html', 21 | 'manifest.json' 22 | ] 23 | ); 24 | 25 | // dynamically cache any other local assets 26 | self.toolbox.router.any('/*', self.toolbox.cacheFirst); 27 | 28 | // for any other requests go to the network, cache, 29 | // and then only use that cached resource if your user goes offline 30 | self.toolbox.router.default = self.toolbox.networkFirst; --------------------------------------------------------------------------------