├── .editorconfig ├── .gitignore ├── .io-config.json ├── config.xml ├── ionic.config.json ├── package.json ├── readme.md ├── 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-40@3x.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-83.5@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@~ipadpro.png │ │ ├── Default-Landscape~ipad.png │ │ ├── Default-Portrait@2x~ipad.png │ │ ├── Default-Portrait@~ipadpro.png │ │ ├── Default-Portrait~ipad.png │ │ ├── Default@2x~iphone.png │ │ └── Default~iphone.png ├── splash.png └── wp8 │ ├── icon │ ├── ApplicationIcon.png │ └── Background.png │ └── splash │ └── SplashScreenImage.png ├── src ├── app │ ├── app.component.ts │ ├── app.html │ ├── app.module.ts │ ├── app.scss │ ├── config.ts │ └── main.ts ├── assets │ ├── i18n │ │ └── en.json │ └── icon │ │ └── favicon.ico ├── declarations.d.ts ├── index.html ├── manifest.json ├── models │ ├── book.model.ts │ ├── credentials.model.ts │ └── user.model.ts ├── pages │ ├── book-add-page │ │ ├── book-add-page.html │ │ ├── book-add-page.module.ts │ │ ├── book-add-page.scss │ │ └── book-add-page.ts │ ├── book-edit-page │ │ ├── book-edit-page.html │ │ ├── book-edit-page.module.ts │ │ ├── book-edit-page.scss │ │ └── book-edit-page.ts │ ├── book-info-page │ │ ├── book-info-page.html │ │ ├── book-info-page.module.ts │ │ ├── book-info-page.scss │ │ └── book-info-page.ts │ ├── books-page │ │ ├── books-page.html │ │ ├── books-page.module.ts │ │ ├── books-page.scss │ │ └── books-page.ts │ ├── forgot-page │ │ ├── forgot-page.html │ │ ├── forgot-page.module.ts │ │ ├── forgot-page.scss │ │ └── forgot-page.ts │ ├── login-page │ │ ├── login-page.html │ │ ├── login-page.module.ts │ │ ├── login-page.scss │ │ └── login-page.ts │ ├── profile-page │ │ ├── profile-page.html │ │ ├── profile-page.module.ts │ │ ├── profile-page.scss │ │ └── profile-page.ts │ ├── protected-page │ │ └── protected-page.ts │ └── register-page │ │ ├── register-page.html │ │ ├── register-page.module.ts │ │ ├── register-page.scss │ │ └── register-page.ts ├── providers │ ├── auth-service.ts │ └── books-service.ts ├── service-worker.js └── theme │ └── variables.scss ├── tsconfig.json └── tslint.json /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig helps developers define and maintain consistent coding styles between different editors and IDEs 2 | # editorconfig.org 3 | 4 | root = true 5 | 6 | [*] 7 | indent_style = space 8 | indent_size = 2 9 | 10 | # We recommend you to keep these unchanged 11 | end_of_line = lf 12 | charset = utf-8 13 | trim_trailing_whitespace = true 14 | insert_final_newline = true 15 | 16 | [*.md] 17 | trim_trailing_whitespace = false -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Specifies intentionally untracked files to ignore when using Git 2 | # http://git-scm.com/docs/gitignore 3 | 4 | *~ 5 | *.sw[mnpcod] 6 | *.log 7 | *.tmp 8 | *.tmp.* 9 | log.txt 10 | *.sublime-project 11 | *.sublime-workspace 12 | .vscode/ 13 | npm-debug.log* 14 | 15 | .idea/ 16 | .sass-cache/ 17 | .tmp/ 18 | .versions/ 19 | coverage/ 20 | dist/ 21 | node_modules/ 22 | tmp/ 23 | temp/ 24 | hooks/ 25 | platforms/ 26 | plugins/ 27 | plugins/android.json 28 | plugins/ios.json 29 | www/ 30 | $RECYCLE.BIN/ 31 | 32 | .DS_Store 33 | Thumbs.db 34 | UserInterfaceState.xcuserstate 35 | -------------------------------------------------------------------------------- /.io-config.json: -------------------------------------------------------------------------------- 1 | {"app_id":""} -------------------------------------------------------------------------------- /config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | ionic3-seed-jwt 4 | Ionic3 seed project with JWT support 5 | Venelin Manchev 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 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /ionic.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ionic3-seed-jwt", 3 | "app_id": "", 4 | "v2": true, 5 | "typescript": true 6 | } 7 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ionic3-seed-jwt", 3 | "version": "0.0.1", 4 | "author": "Venelin Manchev", 5 | "homepage": "http://toxic.digital", 6 | "private": true, 7 | "scripts": { 8 | "clean": "ionic-app-scripts clean", 9 | "build": "ionic-app-scripts build", 10 | "lint": "ionic-app-scripts lint", 11 | "ionic:build": "ionic-app-scripts build", 12 | "ionic:serve": "ionic-app-scripts serve" 13 | }, 14 | "dependencies": { 15 | "@angular/common": "4.1.0", 16 | "@angular/compiler": "4.1.0", 17 | "@angular/compiler-cli": "4.1.0", 18 | "@angular/core": "4.1.0", 19 | "@angular/forms": "4.1.0", 20 | "@angular/http": "4.1.0", 21 | "@angular/platform-browser": "4.1.0", 22 | "@angular/platform-browser-dynamic": "4.1.0", 23 | "@ionic-native/core": "3.7.0", 24 | "@ionic-native/splash-screen": "3.7.0", 25 | "@ionic-native/status-bar": "3.7.0", 26 | "@ionic/storage": "2.0.1", 27 | "@ngx-translate/core": "^6.0.1", 28 | "@ngx-translate/http-loader": "0.0.3", 29 | "angular2-jwt": "^0.2.3", 30 | "ionic-angular": "3.2.0", 31 | "ionicons": "3.0.0", 32 | "rxjs": "5.1.1", 33 | "sw-toolbox": "3.6.0", 34 | "zone.js": "0.8.10" 35 | }, 36 | "devDependencies": { 37 | "@ionic/app-scripts": "1.3.7", 38 | "typescript": "2.2.1" 39 | }, 40 | "cordovaPlugins": [ 41 | "cordova-plugin-whitelist", 42 | "cordova-plugin-console", 43 | "cordova-plugin-statusbar", 44 | "cordova-plugin-device", 45 | "cordova-plugin-splashscreen", 46 | "ionic-plugin-keyboard" 47 | ], 48 | "cordovaPlatforms": [ 49 | "ios", 50 | { 51 | "platform": "ios", 52 | "version": "", 53 | "locator": "ios" 54 | } 55 | ], 56 | "description": "Ionic 3 seed project with JWT support" 57 | } 58 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | ## Ionic 3 seed project with JWT and route guards 2 | 3 | This project is based on the original Ionic 3 project with sidemenu, plus: 4 | * support for JWT 5 | * translation service 6 | * route guards 7 | 8 | I've also setup a demo backend project, to support this one - [Laravel JWT](https://github.com/vmanchev/laravel-jwt) 9 | 10 | Using this seed project, you'll have a working example of 11 | * user registration 12 | * user login 13 | * user logout 14 | * authenticated CRUD requests to the backend 15 | * examples of forms processing 16 | * translation service 17 | * route guards 18 | * custom services 19 | * very simple backend environment configuration (e.g. URLs to your backend API and endpoints) 20 | 21 | 22 | ### ToDo 23 | * Forgot password 24 | * Reset password 25 | * Update user profile 26 | -------------------------------------------------------------------------------- /resources/android/icon/drawable-hdpi-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmanchev/ionic3-seed-jwt/681ee8bdd2a5f6ee52f4d0fb3e8a03fa996c4d1c/resources/android/icon/drawable-hdpi-icon.png -------------------------------------------------------------------------------- /resources/android/icon/drawable-ldpi-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmanchev/ionic3-seed-jwt/681ee8bdd2a5f6ee52f4d0fb3e8a03fa996c4d1c/resources/android/icon/drawable-ldpi-icon.png -------------------------------------------------------------------------------- /resources/android/icon/drawable-mdpi-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmanchev/ionic3-seed-jwt/681ee8bdd2a5f6ee52f4d0fb3e8a03fa996c4d1c/resources/android/icon/drawable-mdpi-icon.png -------------------------------------------------------------------------------- /resources/android/icon/drawable-xhdpi-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmanchev/ionic3-seed-jwt/681ee8bdd2a5f6ee52f4d0fb3e8a03fa996c4d1c/resources/android/icon/drawable-xhdpi-icon.png -------------------------------------------------------------------------------- /resources/android/icon/drawable-xxhdpi-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmanchev/ionic3-seed-jwt/681ee8bdd2a5f6ee52f4d0fb3e8a03fa996c4d1c/resources/android/icon/drawable-xxhdpi-icon.png -------------------------------------------------------------------------------- /resources/android/icon/drawable-xxxhdpi-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmanchev/ionic3-seed-jwt/681ee8bdd2a5f6ee52f4d0fb3e8a03fa996c4d1c/resources/android/icon/drawable-xxxhdpi-icon.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-land-hdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmanchev/ionic3-seed-jwt/681ee8bdd2a5f6ee52f4d0fb3e8a03fa996c4d1c/resources/android/splash/drawable-land-hdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-land-ldpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmanchev/ionic3-seed-jwt/681ee8bdd2a5f6ee52f4d0fb3e8a03fa996c4d1c/resources/android/splash/drawable-land-ldpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-land-mdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmanchev/ionic3-seed-jwt/681ee8bdd2a5f6ee52f4d0fb3e8a03fa996c4d1c/resources/android/splash/drawable-land-mdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-land-xhdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmanchev/ionic3-seed-jwt/681ee8bdd2a5f6ee52f4d0fb3e8a03fa996c4d1c/resources/android/splash/drawable-land-xhdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-land-xxhdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmanchev/ionic3-seed-jwt/681ee8bdd2a5f6ee52f4d0fb3e8a03fa996c4d1c/resources/android/splash/drawable-land-xxhdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-land-xxxhdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmanchev/ionic3-seed-jwt/681ee8bdd2a5f6ee52f4d0fb3e8a03fa996c4d1c/resources/android/splash/drawable-land-xxxhdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-port-hdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmanchev/ionic3-seed-jwt/681ee8bdd2a5f6ee52f4d0fb3e8a03fa996c4d1c/resources/android/splash/drawable-port-hdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-port-ldpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmanchev/ionic3-seed-jwt/681ee8bdd2a5f6ee52f4d0fb3e8a03fa996c4d1c/resources/android/splash/drawable-port-ldpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-port-mdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmanchev/ionic3-seed-jwt/681ee8bdd2a5f6ee52f4d0fb3e8a03fa996c4d1c/resources/android/splash/drawable-port-mdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-port-xhdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmanchev/ionic3-seed-jwt/681ee8bdd2a5f6ee52f4d0fb3e8a03fa996c4d1c/resources/android/splash/drawable-port-xhdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-port-xxhdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmanchev/ionic3-seed-jwt/681ee8bdd2a5f6ee52f4d0fb3e8a03fa996c4d1c/resources/android/splash/drawable-port-xxhdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-port-xxxhdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmanchev/ionic3-seed-jwt/681ee8bdd2a5f6ee52f4d0fb3e8a03fa996c4d1c/resources/android/splash/drawable-port-xxxhdpi-screen.png -------------------------------------------------------------------------------- /resources/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmanchev/ionic3-seed-jwt/681ee8bdd2a5f6ee52f4d0fb3e8a03fa996c4d1c/resources/icon.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmanchev/ionic3-seed-jwt/681ee8bdd2a5f6ee52f4d0fb3e8a03fa996c4d1c/resources/ios/icon/icon-40.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmanchev/ionic3-seed-jwt/681ee8bdd2a5f6ee52f4d0fb3e8a03fa996c4d1c/resources/ios/icon/icon-40@2x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmanchev/ionic3-seed-jwt/681ee8bdd2a5f6ee52f4d0fb3e8a03fa996c4d1c/resources/ios/icon/icon-40@3x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmanchev/ionic3-seed-jwt/681ee8bdd2a5f6ee52f4d0fb3e8a03fa996c4d1c/resources/ios/icon/icon-50.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-50@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmanchev/ionic3-seed-jwt/681ee8bdd2a5f6ee52f4d0fb3e8a03fa996c4d1c/resources/ios/icon/icon-50@2x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmanchev/ionic3-seed-jwt/681ee8bdd2a5f6ee52f4d0fb3e8a03fa996c4d1c/resources/ios/icon/icon-60.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmanchev/ionic3-seed-jwt/681ee8bdd2a5f6ee52f4d0fb3e8a03fa996c4d1c/resources/ios/icon/icon-60@2x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmanchev/ionic3-seed-jwt/681ee8bdd2a5f6ee52f4d0fb3e8a03fa996c4d1c/resources/ios/icon/icon-60@3x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmanchev/ionic3-seed-jwt/681ee8bdd2a5f6ee52f4d0fb3e8a03fa996c4d1c/resources/ios/icon/icon-72.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-72@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmanchev/ionic3-seed-jwt/681ee8bdd2a5f6ee52f4d0fb3e8a03fa996c4d1c/resources/ios/icon/icon-72@2x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmanchev/ionic3-seed-jwt/681ee8bdd2a5f6ee52f4d0fb3e8a03fa996c4d1c/resources/ios/icon/icon-76.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmanchev/ionic3-seed-jwt/681ee8bdd2a5f6ee52f4d0fb3e8a03fa996c4d1c/resources/ios/icon/icon-76@2x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmanchev/ionic3-seed-jwt/681ee8bdd2a5f6ee52f4d0fb3e8a03fa996c4d1c/resources/ios/icon/icon-83.5@2x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmanchev/ionic3-seed-jwt/681ee8bdd2a5f6ee52f4d0fb3e8a03fa996c4d1c/resources/ios/icon/icon-small.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-small@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmanchev/ionic3-seed-jwt/681ee8bdd2a5f6ee52f4d0fb3e8a03fa996c4d1c/resources/ios/icon/icon-small@2x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-small@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmanchev/ionic3-seed-jwt/681ee8bdd2a5f6ee52f4d0fb3e8a03fa996c4d1c/resources/ios/icon/icon-small@3x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmanchev/ionic3-seed-jwt/681ee8bdd2a5f6ee52f4d0fb3e8a03fa996c4d1c/resources/ios/icon/icon.png -------------------------------------------------------------------------------- /resources/ios/icon/icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmanchev/ionic3-seed-jwt/681ee8bdd2a5f6ee52f4d0fb3e8a03fa996c4d1c/resources/ios/icon/icon@2x.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-568h@2x~iphone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmanchev/ionic3-seed-jwt/681ee8bdd2a5f6ee52f4d0fb3e8a03fa996c4d1c/resources/ios/splash/Default-568h@2x~iphone.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-667h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmanchev/ionic3-seed-jwt/681ee8bdd2a5f6ee52f4d0fb3e8a03fa996c4d1c/resources/ios/splash/Default-667h.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-736h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmanchev/ionic3-seed-jwt/681ee8bdd2a5f6ee52f4d0fb3e8a03fa996c4d1c/resources/ios/splash/Default-736h.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-Landscape-736h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmanchev/ionic3-seed-jwt/681ee8bdd2a5f6ee52f4d0fb3e8a03fa996c4d1c/resources/ios/splash/Default-Landscape-736h.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-Landscape@2x~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmanchev/ionic3-seed-jwt/681ee8bdd2a5f6ee52f4d0fb3e8a03fa996c4d1c/resources/ios/splash/Default-Landscape@2x~ipad.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-Landscape@~ipadpro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmanchev/ionic3-seed-jwt/681ee8bdd2a5f6ee52f4d0fb3e8a03fa996c4d1c/resources/ios/splash/Default-Landscape@~ipadpro.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-Landscape~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmanchev/ionic3-seed-jwt/681ee8bdd2a5f6ee52f4d0fb3e8a03fa996c4d1c/resources/ios/splash/Default-Landscape~ipad.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-Portrait@2x~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmanchev/ionic3-seed-jwt/681ee8bdd2a5f6ee52f4d0fb3e8a03fa996c4d1c/resources/ios/splash/Default-Portrait@2x~ipad.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-Portrait@~ipadpro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmanchev/ionic3-seed-jwt/681ee8bdd2a5f6ee52f4d0fb3e8a03fa996c4d1c/resources/ios/splash/Default-Portrait@~ipadpro.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-Portrait~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmanchev/ionic3-seed-jwt/681ee8bdd2a5f6ee52f4d0fb3e8a03fa996c4d1c/resources/ios/splash/Default-Portrait~ipad.png -------------------------------------------------------------------------------- /resources/ios/splash/Default@2x~iphone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmanchev/ionic3-seed-jwt/681ee8bdd2a5f6ee52f4d0fb3e8a03fa996c4d1c/resources/ios/splash/Default@2x~iphone.png -------------------------------------------------------------------------------- /resources/ios/splash/Default~iphone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmanchev/ionic3-seed-jwt/681ee8bdd2a5f6ee52f4d0fb3e8a03fa996c4d1c/resources/ios/splash/Default~iphone.png -------------------------------------------------------------------------------- /resources/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmanchev/ionic3-seed-jwt/681ee8bdd2a5f6ee52f4d0fb3e8a03fa996c4d1c/resources/splash.png -------------------------------------------------------------------------------- /resources/wp8/icon/ApplicationIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmanchev/ionic3-seed-jwt/681ee8bdd2a5f6ee52f4d0fb3e8a03fa996c4d1c/resources/wp8/icon/ApplicationIcon.png -------------------------------------------------------------------------------- /resources/wp8/icon/Background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmanchev/ionic3-seed-jwt/681ee8bdd2a5f6ee52f4d0fb3e8a03fa996c4d1c/resources/wp8/icon/Background.png -------------------------------------------------------------------------------- /resources/wp8/splash/SplashScreenImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmanchev/ionic3-seed-jwt/681ee8bdd2a5f6ee52f4d0fb3e8a03fa996c4d1c/resources/wp8/splash/SplashScreenImage.png -------------------------------------------------------------------------------- /src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import {Component, ViewChild} from '@angular/core'; 2 | import {Nav, Platform} from 'ionic-angular'; 3 | import {StatusBar} from '@ionic-native/status-bar'; 4 | import {SplashScreen} from '@ionic-native/splash-screen'; 5 | import {AuthService} from '../providers/auth-service'; 6 | import {TranslateService} from '@ngx-translate/core'; 7 | 8 | @Component({ 9 | templateUrl: 'app.html' 10 | }) 11 | export class MyApp { 12 | @ViewChild(Nav) nav: Nav; 13 | 14 | rootPage: any = 'ProfilePage'; 15 | 16 | pages: Array<{title: string, component: any, method?: any}>; 17 | 18 | constructor( 19 | public platform: Platform, 20 | public statusBar: StatusBar, 21 | public splashScreen: SplashScreen, 22 | public authService: AuthService, 23 | translate: TranslateService) { 24 | 25 | this.initializeApp(); 26 | 27 | translate.setDefaultLang('en'); 28 | 29 | // used for an example of ngFor and navigation 30 | this.pages = [ 31 | {title: 'page.profile', component: 'ProfilePage'}, 32 | {title: 'page.books.list', component: 'BooksPage'}, 33 | {title: 'page.logout', component: 'LoginPage', method: 'logout'} 34 | ]; 35 | 36 | } 37 | 38 | initializeApp() { 39 | this.platform.ready().then(() => { 40 | // Okay, so the platform is ready and our plugins are available. 41 | // Here you can do any higher level native things you might need. 42 | this.statusBar.styleDefault(); 43 | this.splashScreen.hide(); 44 | this.authService.startupTokenRefresh(); 45 | }); 46 | } 47 | 48 | openPage(page) { 49 | 50 | if (page.method && page.method === 'logout') { 51 | this.authService.logout(); 52 | } 53 | 54 | this.nav.setRoot(page.component); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/app/app.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Меню 7 | 8 | 9 | 10 | 11 | 12 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import {BrowserModule} from '@angular/platform-browser'; 2 | import {ErrorHandler, NgModule} from '@angular/core'; 3 | import {IonicApp, IonicErrorHandler, IonicModule} from 'ionic-angular'; 4 | import {IonicStorageModule} from '@ionic/storage'; 5 | import {MyApp} from './app.component'; 6 | import {HttpModule, Http} from '@angular/http'; 7 | import {AuthHttp, AuthConfig,JwtHelper} from 'angular2-jwt'; 8 | import {Storage} from '@ionic/storage'; 9 | import {AuthService} from '../providers/auth-service'; 10 | import {BooksService} from '../providers/books-service'; 11 | import {TranslateModule, TranslateLoader} from '@ngx-translate/core'; 12 | import {TranslateHttpLoader} from '@ngx-translate/http-loader'; 13 | 14 | import {StatusBar} from '@ionic-native/status-bar'; 15 | import {SplashScreen} from '@ionic-native/splash-screen'; 16 | 17 | let storage = new Storage({}); 18 | 19 | export function getAuthHttp(http) { 20 | return new AuthHttp(new AuthConfig({ 21 | noJwtError: true, 22 | globalHeaders: [{'Accept': 'application/json'}], 23 | tokenGetter: (() => storage.get('id_token')), 24 | }), http); 25 | } 26 | 27 | export function createTranslateLoader(http: Http) { 28 | return new TranslateHttpLoader(http, './assets/i18n/', '.json'); 29 | } 30 | 31 | @NgModule({ 32 | declarations: [ 33 | MyApp 34 | ], 35 | imports: [ 36 | BrowserModule, 37 | IonicModule.forRoot(MyApp), 38 | IonicStorageModule.forRoot(), 39 | HttpModule, 40 | TranslateModule.forRoot({ 41 | loader: { 42 | provide: TranslateLoader, 43 | useFactory: (createTranslateLoader), 44 | deps: [Http] 45 | } 46 | }) 47 | ], 48 | bootstrap: [IonicApp], 49 | entryComponents: [ 50 | MyApp 51 | ], 52 | providers: [ 53 | StatusBar, 54 | JwtHelper, 55 | SplashScreen, 56 | {provide: ErrorHandler, useClass: IonicErrorHandler}, 57 | { 58 | provide: AuthHttp, 59 | useFactory: getAuthHttp, 60 | deps: [Http] 61 | }, 62 | AuthService, 63 | BooksService 64 | ] 65 | }) 66 | export class AppModule {} 67 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /src/app/config.ts: -------------------------------------------------------------------------------- 1 | export let cfg = { 2 | apiUrl: 'http://books.prodio.bg/api', 3 | tokenName: 'token', 4 | user: { 5 | register: '/auth/signup', 6 | login: '/auth/login', 7 | refresh:'/refresh', 8 | }, 9 | books: '/books' 10 | }; 11 | -------------------------------------------------------------------------------- /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/i18n/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": { 3 | "email": "Email address", 4 | "password": "Password", 5 | "name": "Name", 6 | "password": "Password", 7 | "confirm_password" : "Confirm password", 8 | "title" : "Title", 9 | "author_name": "Author", 10 | "pages": "Pages" 11 | }, 12 | "button" : { 13 | "login" : "Login", 14 | "register" : "Register", 15 | "new_registration" : "New registration", 16 | "forgotten_password" : "Forgotten password?", 17 | "submit" : "Submit", 18 | "add_book": "Add new book", 19 | "edit": "Edit", 20 | "delete": "Delete" 21 | }, 22 | "page" : { 23 | "login" : "Login", 24 | "logout" : "Logout", 25 | "register" : "New registration", 26 | "forgotten_password" : "Password recovery", 27 | "profile" : "Profile", 28 | "books" : { 29 | "list" : "My books", 30 | "add": "Add book", 31 | "edit" : "Edit book", 32 | "preview": "Preview" 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/assets/icon/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmanchev/ionic3-seed-jwt/681ee8bdd2a5f6ee52f4d0fb3e8a03fa996c4d1c/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 | Ionic App 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /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/models/book.model.ts: -------------------------------------------------------------------------------- 1 | export class BookModel { 2 | 3 | public id?: number; 4 | public user_id?: number; 5 | public title: string; 6 | public author_name: string; 7 | public pages_count: string; 8 | public created_at?: string; 9 | public updated_at?: string; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /src/models/credentials.model.ts: -------------------------------------------------------------------------------- 1 | export class CredentialsModel { 2 | 3 | public email: string; 4 | public password: string; 5 | 6 | } 7 | -------------------------------------------------------------------------------- /src/models/user.model.ts: -------------------------------------------------------------------------------- 1 | export class UserModel { 2 | 3 | public name: string; 4 | public email: string; 5 | public password: string; 6 | public confirm_password?: string; 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/pages/book-add-page/book-add-page.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | {{ 'page.books.add' | translate }} 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | {{ 'label.title' | translate }}: 21 | 22 | 23 | 24 | 25 | {{ 'label.author_name' | translate }}: 26 | 27 | 28 | 29 | 30 | {{ 'label.pages' | translate }}: 31 | 32 | 33 | 34 | 35 | 36 | 37 |
38 | 39 |
40 | 41 |
42 | 43 | 44 | 45 |
46 | 47 |
48 | -------------------------------------------------------------------------------- /src/pages/book-add-page/book-add-page.module.ts: -------------------------------------------------------------------------------- 1 | import {NgModule} from '@angular/core'; 2 | import {IonicPageModule} from 'ionic-angular'; 3 | import {BookAddPage} from './book-add-page'; 4 | import {TranslateModule} from '@ngx-translate/core'; 5 | 6 | @NgModule({ 7 | declarations: [ 8 | BookAddPage, 9 | ], 10 | imports: [ 11 | IonicPageModule.forChild(BookAddPage), 12 | TranslateModule.forChild() 13 | ], 14 | exports: [ 15 | BookAddPage 16 | ] 17 | }) 18 | export class BookAddPageModule {} 19 | -------------------------------------------------------------------------------- /src/pages/book-add-page/book-add-page.scss: -------------------------------------------------------------------------------- 1 | page-book-add-page { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /src/pages/book-add-page/book-add-page.ts: -------------------------------------------------------------------------------- 1 | import {Component} from '@angular/core'; 2 | import {IonicPage, NavController, NavParams, MenuController} from 'ionic-angular'; 3 | import {ProtectedPage} from '../protected-page/protected-page'; 4 | import {Storage} from '@ionic/storage'; 5 | import {Validators, FormBuilder, FormGroup} from '@angular/forms'; 6 | import {BooksService} from '../../providers/books-service'; 7 | 8 | @IonicPage() 9 | @Component({ 10 | selector: 'page-book-add-page', 11 | templateUrl: 'book-add-page.html', 12 | }) 13 | export class BookAddPage extends ProtectedPage { 14 | 15 | private bookData: FormGroup; 16 | 17 | constructor( 18 | public navCtrl: NavController, 19 | public navParams: NavParams, 20 | public menuCtrl: MenuController, 21 | public storage: Storage, 22 | public formBuilder: FormBuilder, 23 | public booksService: BooksService) { 24 | 25 | super(navCtrl, navParams, storage); 26 | 27 | this.bookData = this.formBuilder.group({ 28 | title: ['', Validators.required], 29 | author_name: ['', Validators.required], 30 | pages_count: ['', Validators.required], 31 | }); 32 | } 33 | 34 | process() { 35 | this.booksService.add(this.bookData.value) 36 | .then(() => this.navCtrl.push('BooksPage')) 37 | .catch((e) => console.log("add book error", e)); 38 | } 39 | 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/pages/book-edit-page/book-edit-page.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | {{ 'page.books.edit' | translate }} 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | {{ 'label.title' | translate }}: 21 | 22 | 23 | 24 | 25 | {{ 'label.author_name' | translate }}: 26 | 27 | 28 | 29 | 30 | {{ 'label.pages' | translate }}: 31 | 32 | 33 | 34 | 35 | 36 | 37 |
38 | 39 |
40 | 41 |
42 | 43 | 44 | 45 |
46 | 47 |
48 | -------------------------------------------------------------------------------- /src/pages/book-edit-page/book-edit-page.module.ts: -------------------------------------------------------------------------------- 1 | import {NgModule} from '@angular/core'; 2 | import {IonicPageModule} from 'ionic-angular'; 3 | import {BookEditPage} from './book-edit-page'; 4 | import {TranslateModule} from '@ngx-translate/core'; 5 | 6 | @NgModule({ 7 | declarations: [ 8 | BookEditPage, 9 | ], 10 | imports: [ 11 | IonicPageModule.forChild(BookEditPage), 12 | TranslateModule.forChild() 13 | ], 14 | exports: [ 15 | BookEditPage 16 | ] 17 | }) 18 | export class BookEditPageModule {} 19 | -------------------------------------------------------------------------------- /src/pages/book-edit-page/book-edit-page.scss: -------------------------------------------------------------------------------- 1 | page-book-add-page { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /src/pages/book-edit-page/book-edit-page.ts: -------------------------------------------------------------------------------- 1 | import {Component} from '@angular/core'; 2 | import {IonicPage, NavController, NavParams, MenuController} from 'ionic-angular'; 3 | import {ProtectedPage} from '../protected-page/protected-page'; 4 | import {Storage} from '@ionic/storage'; 5 | import {Validators, FormBuilder, FormGroup} from '@angular/forms'; 6 | import {BooksService} from '../../providers/books-service'; 7 | import {BookModel} from '../../models/book.model'; 8 | 9 | @IonicPage() 10 | @Component({ 11 | selector: 'page-book-edit-page', 12 | templateUrl: 'book-edit-page.html', 13 | }) 14 | export class BookEditPage extends ProtectedPage { 15 | 16 | private bookData: FormGroup; 17 | private book: BookModel; 18 | 19 | constructor( 20 | public navCtrl: NavController, 21 | public navParams: NavParams, 22 | public menuCtrl: MenuController, 23 | public storage: Storage, 24 | public formBuilder: FormBuilder, 25 | public booksService: BooksService) { 26 | 27 | super(navCtrl, navParams, storage); 28 | 29 | this.book = navParams.get('book'); 30 | 31 | 32 | this.bookData = this.formBuilder.group({ 33 | title: [this.book.title, Validators.required], 34 | author_name: [this.book.author_name, Validators.required], 35 | pages_count: [this.book.pages_count, Validators.required], 36 | }); 37 | } 38 | 39 | process() { 40 | 41 | let updatedBook = Object.assign(this.book, this.bookData.value); 42 | 43 | this.booksService.update(updatedBook) 44 | .then(() => this.navCtrl.pop()) 45 | .catch((e) => console.log("add book error", e)); 46 | } 47 | 48 | 49 | } 50 | -------------------------------------------------------------------------------- /src/pages/book-info-page/book-info-page.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | {{ 'page.books.preview' | translate }} 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |

{{ book.title }}

18 | by {{ book.author_name }}, p. {{ book.pages_count }} 19 |
20 | 21 | 22 | 23 | 24 | 28 | 29 | 30 | 31 | 35 | 36 | 37 | 38 | 39 | 40 |
41 | 42 |
43 | -------------------------------------------------------------------------------- /src/pages/book-info-page/book-info-page.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { IonicPageModule } from 'ionic-angular'; 3 | import { BookInfoPage } from './book-info-page'; 4 | import {TranslateModule} from '@ngx-translate/core'; 5 | 6 | @NgModule({ 7 | declarations: [ 8 | BookInfoPage, 9 | ], 10 | imports: [ 11 | IonicPageModule.forChild(BookInfoPage), 12 | TranslateModule.forChild() 13 | ], 14 | exports: [ 15 | BookInfoPage 16 | ] 17 | }) 18 | export class BookInfoPageModule {} 19 | -------------------------------------------------------------------------------- /src/pages/book-info-page/book-info-page.scss: -------------------------------------------------------------------------------- 1 | page-book-info-page { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /src/pages/book-info-page/book-info-page.ts: -------------------------------------------------------------------------------- 1 | import {Component} from '@angular/core'; 2 | import {IonicPage, NavController, NavParams, MenuController} from 'ionic-angular'; 3 | import {ProtectedPage} from '../protected-page/protected-page'; 4 | import {Storage} from '@ionic/storage'; 5 | import {BooksService} from '../../providers/books-service'; 6 | import {BookModel} from '../../models/book.model'; 7 | 8 | @IonicPage() 9 | @Component({ 10 | selector: 'page-book-info-page', 11 | templateUrl: 'book-info-page.html', 12 | }) 13 | export class BookInfoPage extends ProtectedPage { 14 | 15 | private book: BookModel; 16 | 17 | constructor( 18 | public navCtrl: NavController, 19 | public navParams: NavParams, 20 | public menuCtrl: MenuController, 21 | public storage: Storage, 22 | public booksService: BooksService) { 23 | 24 | super(navCtrl, navParams, storage); 25 | 26 | this.book = navParams.get('book'); 27 | 28 | } 29 | 30 | editBook(book: BookModel) { 31 | this.navCtrl.push('BookEditPage', {book: book}); 32 | } 33 | 34 | deleteBook(book: BookModel) { 35 | this.booksService.remove(book.id) 36 | .then(() => this.navCtrl.pop()) 37 | .catch(e => console.log("delete book error", e)); 38 | } 39 | 40 | 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/pages/books-page/books-page.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | {{ 'page.books.list' | translate }} 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/pages/books-page/books-page.module.ts: -------------------------------------------------------------------------------- 1 | import {NgModule} from '@angular/core'; 2 | import {IonicPageModule} from 'ionic-angular'; 3 | import {BooksPage} from './books-page'; 4 | import {TranslateModule} from '@ngx-translate/core'; 5 | 6 | @NgModule({ 7 | declarations: [ 8 | BooksPage, 9 | ], 10 | imports: [ 11 | IonicPageModule.forChild(BooksPage), 12 | TranslateModule.forChild() 13 | ], 14 | exports: [ 15 | BooksPage 16 | ] 17 | }) 18 | export class BooksPageModule {} 19 | -------------------------------------------------------------------------------- /src/pages/books-page/books-page.scss: -------------------------------------------------------------------------------- 1 | page-books-page { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /src/pages/books-page/books-page.ts: -------------------------------------------------------------------------------- 1 | import {Component} from '@angular/core'; 2 | import {IonicPage, NavController, NavParams, MenuController} from 'ionic-angular'; 3 | import {ProtectedPage} from '../protected-page/protected-page'; 4 | import {Storage} from '@ionic/storage'; 5 | import {BooksService} from '../../providers/books-service'; 6 | import {BookModel} from '../../models/book.model'; 7 | 8 | @IonicPage() 9 | @Component({ 10 | selector: 'page-books-page', 11 | templateUrl: 'books-page.html', 12 | }) 13 | export class BooksPage extends ProtectedPage { 14 | 15 | public books: any; 16 | 17 | constructor( 18 | public navCtrl: NavController, 19 | public navParams: NavParams, 20 | public menuCtrl: MenuController, 21 | public storage: Storage, 22 | public booksService: BooksService) { 23 | 24 | super(navCtrl, navParams, storage); 25 | 26 | } 27 | 28 | ionViewWillEnter() { 29 | this.booksService.getAll().then(books => this.books = books); 30 | } 31 | 32 | bookInfo(book: BookModel) { 33 | this.navCtrl.push('BookInfoPage', {book: book}); 34 | } 35 | 36 | /** 37 | * Opens a paage 38 | * 39 | * @param page string Page name 40 | */ 41 | openPage(page: string) { 42 | this.navCtrl.push(page); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/pages/forgot-page/forgot-page.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | {{ 'page.forgotten_password' | translate }} 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | {{ 'label.email' | translate }}: 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 |
29 |
30 |
31 | 32 |
33 | -------------------------------------------------------------------------------- /src/pages/forgot-page/forgot-page.module.ts: -------------------------------------------------------------------------------- 1 | import {NgModule} from '@angular/core'; 2 | import {IonicPageModule} from 'ionic-angular'; 3 | import {ForgotPage} from './forgot-page'; 4 | import {TranslateModule} from '@ngx-translate/core'; 5 | 6 | @NgModule({ 7 | declarations: [ 8 | ForgotPage, 9 | ], 10 | imports: [ 11 | IonicPageModule.forChild(ForgotPage), 12 | TranslateModule.forChild() 13 | ], 14 | exports: [ 15 | ForgotPage 16 | ] 17 | }) 18 | export class ForgotPageModule {} 19 | -------------------------------------------------------------------------------- /src/pages/forgot-page/forgot-page.scss: -------------------------------------------------------------------------------- 1 | page-forgot-page { 2 | 3 | scroll-content { 4 | display: flex; 5 | flex-direction: column; 6 | } 7 | 8 | ion-item.item-ios { 9 | padding-left: 0; 10 | } 11 | 12 | ion-grid { 13 | padding: 0; 14 | height: 100%; 15 | } 16 | 17 | ion-row { 18 | flex: 1; 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/pages/forgot-page/forgot-page.ts: -------------------------------------------------------------------------------- 1 | import {Component} from '@angular/core'; 2 | import {IonicPage, NavController, NavParams, MenuController} from 'ionic-angular'; 3 | import {Storage} from '@ionic/storage'; 4 | import {Validators, FormBuilder, FormGroup} from '@angular/forms'; 5 | import {AuthService} from '../../providers/auth-service'; 6 | 7 | 8 | @IonicPage() 9 | @Component({ 10 | selector: 'page-forgot-page', 11 | templateUrl: 'forgot-page.html', 12 | }) 13 | export class ForgotPage { 14 | 15 | private forgotData: FormGroup; 16 | 17 | constructor( 18 | public navCtrl: NavController, 19 | public navParams: NavParams, 20 | public menuCtrl: MenuController, 21 | public storage: Storage, 22 | public formBuilder: FormBuilder, 23 | public authService: AuthService) { 24 | 25 | this.forgotData = this.formBuilder.group({ 26 | egn: ['', Validators.compose([Validators.required, Validators.minLength(10), , Validators.maxLength(10)])], 27 | email: ['', Validators.required], 28 | }); 29 | 30 | } 31 | 32 | ionViewDidLoad() { 33 | //hide menu when on the login page, regardless of the screen resolution 34 | this.menuCtrl.enable(false); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/pages/login-page/login-page.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{ 'page.login' | translate }} 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | {{ 'label.email' | translate }}: 18 | 19 | 20 | 21 | {{ 'label.password' | translate }}: 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 |
39 | 40 |
41 | 42 | 43 | 44 |
45 | 46 |
47 | -------------------------------------------------------------------------------- /src/pages/login-page/login-page.module.ts: -------------------------------------------------------------------------------- 1 | import {NgModule} from '@angular/core'; 2 | import {IonicPageModule} from 'ionic-angular'; 3 | import {LoginPage} from './login-page'; 4 | import {TranslateModule} from '@ngx-translate/core'; 5 | 6 | @NgModule({ 7 | declarations: [ 8 | LoginPage, 9 | ], 10 | imports: [ 11 | IonicPageModule.forChild(LoginPage), 12 | TranslateModule.forChild() 13 | ], 14 | exports: [ 15 | LoginPage 16 | ] 17 | }) 18 | export class LoginPageModule {} 19 | -------------------------------------------------------------------------------- /src/pages/login-page/login-page.scss: -------------------------------------------------------------------------------- 1 | page-login-page { 2 | 3 | scroll-content { 4 | display: flex; 5 | flex-direction: column; 6 | } 7 | 8 | ion-item.item-ios { 9 | padding-left: 0; 10 | } 11 | 12 | ion-grid { 13 | padding: 0; 14 | height: 100%; 15 | } 16 | 17 | ion-row { 18 | flex: 1; 19 | } 20 | 21 | 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/pages/login-page/login-page.ts: -------------------------------------------------------------------------------- 1 | import {Component} from '@angular/core'; 2 | import {IonicPage, NavController, NavParams, MenuController} from 'ionic-angular'; 3 | import {Storage} from '@ionic/storage'; 4 | import {Validators, FormBuilder, FormGroup} from '@angular/forms'; 5 | import {AuthService} from '../../providers/auth-service'; 6 | 7 | import {UserModel} from '../../models/user.model'; 8 | 9 | @IonicPage() 10 | @Component({ 11 | selector: 'page-login-page', 12 | templateUrl: 'login-page.html', 13 | }) 14 | export class LoginPage { 15 | 16 | private loginData: FormGroup; 17 | public user: UserModel; 18 | 19 | constructor( 20 | public navCtrl: NavController, 21 | public navParams: NavParams, 22 | public menuCtrl: MenuController, 23 | public storage: Storage, 24 | public formBuilder: FormBuilder, 25 | public authService: AuthService) { 26 | 27 | this.loginData = this.formBuilder.group({ 28 | email: ['', Validators.compose([Validators.required])], 29 | password: ['', Validators.compose([Validators.required, Validators.minLength(6)])], 30 | }); 31 | } 32 | 33 | ionViewDidLoad() { 34 | //hide menu when on the login page, regardless of the screen resolution 35 | this.menuCtrl.enable(false); 36 | } 37 | 38 | login() { 39 | //use this.loginData.value to authenticate the user 40 | this.authService.login(this.loginData.value) 41 | .then(() => this.redirectToHome()) 42 | .catch(e => console.log("login error", e)); 43 | } 44 | 45 | redirectToHome() { 46 | this.navCtrl.setRoot('ProfilePage'); 47 | this.menuCtrl.enable(true); 48 | } 49 | 50 | /** 51 | * Opens a paage 52 | * 53 | * @param page string Page name 54 | */ 55 | openPage(page: string) { 56 | this.navCtrl.push(page); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/pages/profile-page/profile-page.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | {{ 'page.profile' | translate }} 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | {{ 'label.name' | translate }}: 19 | {{ user.name }} 20 | 21 | 22 | 23 | {{ 'label.email' | translate }}: 24 | {{ user.email }} 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /src/pages/profile-page/profile-page.module.ts: -------------------------------------------------------------------------------- 1 | import {NgModule} from '@angular/core'; 2 | import {IonicPageModule} from 'ionic-angular'; 3 | import {ProfilePage} from './profile-page'; 4 | import {TranslateModule} from '@ngx-translate/core'; 5 | 6 | @NgModule({ 7 | declarations: [ 8 | ProfilePage, 9 | ], 10 | imports: [ 11 | IonicPageModule.forChild(ProfilePage), 12 | TranslateModule.forChild() 13 | ], 14 | exports: [ 15 | ProfilePage 16 | ] 17 | }) 18 | export class ProfilePageModule {} 19 | -------------------------------------------------------------------------------- /src/pages/profile-page/profile-page.scss: -------------------------------------------------------------------------------- 1 | page-home-page { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /src/pages/profile-page/profile-page.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { IonicPage, NavController, NavParams, MenuController } from 'ionic-angular'; 3 | import {ProtectedPage} from '../protected-page/protected-page'; 4 | import {Storage} from '@ionic/storage'; 5 | import {UserModel} from '../../models/user.model'; 6 | 7 | @IonicPage() 8 | @Component({ 9 | selector: 'page-profile-page', 10 | templateUrl: 'profile-page.html', 11 | }) 12 | export class ProfilePage extends ProtectedPage { 13 | 14 | public user: UserModel; 15 | 16 | constructor( 17 | public navCtrl: NavController, 18 | public navParams: NavParams, 19 | public menuCtrl: MenuController, 20 | public storage: Storage) { 21 | 22 | super(navCtrl, navParams, storage); 23 | 24 | this.storage.get('user').then(user => { 25 | this.user = user; 26 | }); 27 | 28 | } 29 | 30 | ionViewDidLoad() { 31 | this.menuCtrl.enable(true); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/pages/protected-page/protected-page.ts: -------------------------------------------------------------------------------- 1 | import {NavController, NavParams} from 'ionic-angular'; 2 | import {Storage} from '@ionic/storage'; 3 | 4 | export class ProtectedPage { 5 | 6 | constructor( 7 | public navCtrl: NavController, 8 | public navParams: NavParams, 9 | public storage: Storage) { 10 | } 11 | 12 | ionViewCanEnter() { 13 | 14 | this.storage.get('id_token').then(id_token => { 15 | if (id_token === null) { 16 | this.navCtrl.setRoot('LoginPage'); 17 | return false; 18 | } 19 | }); 20 | 21 | return true; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/pages/register-page/register-page.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | {{ 'page.register' | translate }} 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | {{ 'label.name' | translate }}: 22 | 23 | 24 | 25 | 26 | {{ 'label.email' | translate }}: 27 | 28 | 29 | 30 | 31 | {{ 'label.password' | translate }}: 32 | 33 | 34 | 35 | 36 | {{ 'label.confirm_password' | translate }}: 37 | 38 | 39 | 40 | 41 | 42 |
43 | 44 |
45 |
46 |
47 | 48 | 49 | 50 | 51 |
52 | -------------------------------------------------------------------------------- /src/pages/register-page/register-page.module.ts: -------------------------------------------------------------------------------- 1 | import {NgModule} from '@angular/core'; 2 | import {IonicPageModule} from 'ionic-angular'; 3 | import {RegisterPage} from './register-page'; 4 | import {TranslateModule} from '@ngx-translate/core'; 5 | 6 | @NgModule({ 7 | declarations: [ 8 | RegisterPage, 9 | ], 10 | imports: [ 11 | IonicPageModule.forChild(RegisterPage), 12 | TranslateModule.forChild() 13 | ], 14 | exports: [ 15 | RegisterPage 16 | ] 17 | }) 18 | export class RegisterPageModule {} 19 | -------------------------------------------------------------------------------- /src/pages/register-page/register-page.scss: -------------------------------------------------------------------------------- 1 | page-register-page { 2 | 3 | ion-item.item-ios { 4 | padding-left: 0; 5 | } 6 | 7 | 8 | 9 | 10 | } 11 | -------------------------------------------------------------------------------- /src/pages/register-page/register-page.ts: -------------------------------------------------------------------------------- 1 | import {Component} from '@angular/core'; 2 | import {IonicPage, NavController, NavParams, MenuController} from 'ionic-angular'; 3 | import {Storage} from '@ionic/storage'; 4 | import {Validators, FormBuilder, FormGroup} from '@angular/forms'; 5 | import {AuthService} from '../../providers/auth-service'; 6 | 7 | 8 | @IonicPage() 9 | @Component({ 10 | selector: 'page-register-page', 11 | templateUrl: 'register-page.html', 12 | }) 13 | export class RegisterPage { 14 | 15 | private regData: FormGroup; 16 | 17 | constructor( 18 | public navCtrl: NavController, 19 | public navParams: NavParams, 20 | public menuCtrl: MenuController, 21 | public storage: Storage, 22 | public formBuilder: FormBuilder, 23 | public authService: AuthService) { 24 | 25 | this.regData = this.formBuilder.group({ 26 | name: ['', Validators.required], 27 | email: ['', Validators.required], 28 | password: ['', Validators.required], 29 | confirm_password: ['', Validators.required] 30 | }); 31 | 32 | } 33 | 34 | ionViewDidLoad() { 35 | //hide menu when on the login page, regardless of the screen resolution 36 | this.menuCtrl.enable(false); 37 | } 38 | 39 | register() { 40 | 41 | this.authService.register(this.regData.value) 42 | .then(() => this.navCtrl.setRoot('ProfilePage')) 43 | .catch(e => console.log("reg error", e)); 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/providers/auth-service.ts: -------------------------------------------------------------------------------- 1 | import {Injectable} from '@angular/core'; 2 | import {Http} from '@angular/http'; 3 | import {Storage} from '@ionic/storage'; 4 | import 'rxjs/add/operator/toPromise'; 5 | import {UserModel} from '../models/user.model'; 6 | import {CredentialsModel} from '../models/credentials.model'; 7 | import {AuthHttp, JwtHelper, tokenNotExpired} from 'angular2-jwt'; 8 | import {Observable} from 'rxjs/Rx'; 9 | import * as AppConfig from '../app/config'; 10 | 11 | @Injectable() 12 | export class AuthService { 13 | 14 | private cfg: any; 15 | idToken: string; 16 | refreshSubscription: any; 17 | 18 | 19 | constructor( 20 | private storage: Storage, 21 | private http: Http, 22 | private jwtHelper:JwtHelper, 23 | private authHttp: AuthHttp) { 24 | 25 | this.cfg = AppConfig.cfg; 26 | this.storage.get('id_token').then(token => { 27 | this.idToken = token; 28 | }); 29 | 30 | } 31 | 32 | register(userData: UserModel) { 33 | 34 | return this.http.post(this.cfg.apiUrl + this.cfg.user.register, userData) 35 | .toPromise() 36 | .then(data => { 37 | this.saveData(data) 38 | let rs = data.json(); 39 | this.idToken = rs.token; 40 | this.scheduleRefresh(); 41 | }) 42 | .catch(e => console.log("reg error", e)); 43 | 44 | 45 | } 46 | 47 | login(credentials: CredentialsModel) { 48 | 49 | return this.http.post(this.cfg.apiUrl + this.cfg.user.login, credentials) 50 | .toPromise() 51 | .then(data => { 52 | let rs = data.json(); 53 | this.saveData(data); 54 | this.idToken = rs.token; 55 | this.scheduleRefresh(); 56 | }) 57 | .catch(e => console.log('login error', e)); 58 | 59 | 60 | } 61 | 62 | saveData(data: any) { 63 | 64 | let rs = data.json(); 65 | 66 | this.storage.set("user", rs.user); 67 | this.storage.set("id_token", rs.token); 68 | } 69 | 70 | logout() { 71 | // stop function of auto refesh 72 | this.unscheduleRefresh(); 73 | this.storage.remove('user'); 74 | this.storage.remove('id_token'); 75 | 76 | } 77 | 78 | isValid() { 79 | return tokenNotExpired(); 80 | } 81 | 82 | 83 | public getNewJwt() { 84 | // Get a new JWT from Auth0 using the refresh token saved 85 | // in local storage 86 | this.storage.get("id_token").then((thetoken)=>{ 87 | 88 | let senddata: { Token:string} = { 89 | Token : thetoken 90 | }; 91 | 92 | this.http.get(this.cfg.apiUrl + this.cfg.user.refresh+"?Token="+thetoken) 93 | .map(res => res.json()) 94 | .subscribe(res => { 95 | console.log(JSON.stringify(res)); 96 | console.log(res.status); 97 | // If the API returned a successful response, mark the user as logged in 98 | // this need to be fixed on Laravel project to retun the New Token ; 99 | if(res.status == 'success') { 100 | this.storage.set("id_token", res.token); 101 | 102 | } else { 103 | console.log("The Token Black Listed"); 104 | this.logout(); 105 | 106 | } 107 | }, err => { 108 | console.error('ERROR', err); 109 | }); 110 | 111 | }); 112 | 113 | } 114 | 115 | 116 | public scheduleRefresh() { 117 | // If the user is authenticated, use the token stream 118 | // provided by angular2-jwt and flatMap the token 119 | 120 | let source = Observable.of(this.idToken).flatMap( 121 | token => { 122 | // The delay to generate in this case is the difference 123 | // between the expiry time and the issued at time 124 | let jwtIat = this.jwtHelper.decodeToken(token).iat; 125 | let jwtExp = this.jwtHelper.decodeToken(token).exp; 126 | let iat = new Date(0); 127 | let exp = new Date(0); 128 | 129 | let delay = (exp.setUTCSeconds(jwtExp) - iat.setUTCSeconds(jwtIat)); 130 | console.log("will start refresh after :",(delay/1000)/60); 131 | if(delay-1000<=0) 132 | delay = 1; 133 | return Observable.interval(delay); 134 | }); 135 | 136 | this.refreshSubscription = source.subscribe(() => { 137 | this.getNewJwt(); 138 | }); 139 | } 140 | 141 | 142 | 143 | public startupTokenRefresh() { 144 | // If the user is authenticated, use the token stream 145 | // provided by angular2-jwt and flatMap the token 146 | 147 | this.storage.get("id_token").then((thetoken)=>{ 148 | 149 | if(thetoken){ 150 | 151 | let source = Observable.of(thetoken).flatMap( 152 | token => { 153 | // Get the expiry time to generate 154 | // a delay in milliseconds 155 | let now: number = new Date().valueOf(); 156 | let jwtExp: number = this.jwtHelper.decodeToken(token).exp; 157 | let exp: Date = new Date(0); 158 | exp.setUTCSeconds(jwtExp); 159 | let delay: number = exp.valueOf() - now; 160 | 161 | if(delay <= 0) { 162 | delay=1; 163 | } 164 | // Use the delay in a timer to 165 | // run the refresh at the proper time 166 | return Observable.timer(delay); 167 | }); 168 | 169 | // Once the delay time from above is 170 | // reached, get a new JWT and schedule 171 | // additional refreshes 172 | source.subscribe(() => { 173 | this.getNewJwt(); 174 | this.scheduleRefresh(); 175 | }); 176 | 177 | }else{ 178 | //there is no user logined 179 | console.info("there is no user logined "); 180 | 181 | } 182 | 183 | }); 184 | 185 | 186 | } 187 | 188 | 189 | 190 | 191 | public unscheduleRefresh() { 192 | // Unsubscribe fromt the refresh 193 | if (this.refreshSubscription) { 194 | this.refreshSubscription.unsubscribe(); 195 | } 196 | } 197 | 198 | } 199 | -------------------------------------------------------------------------------- /src/providers/books-service.ts: -------------------------------------------------------------------------------- 1 | import {Injectable} from '@angular/core'; 2 | import {AuthHttp} from 'angular2-jwt'; 3 | import {BookModel} from '../models/book.model'; 4 | import 'rxjs/add/operator/map'; 5 | import 'rxjs/add/operator/toPromise'; 6 | import * as AppConfig from '../app/config'; 7 | 8 | @Injectable() 9 | export class BooksService { 10 | 11 | private cfg: any; 12 | 13 | constructor( 14 | private authHttp: AuthHttp) { 15 | 16 | this.cfg = AppConfig.cfg; 17 | } 18 | 19 | getAll() { 20 | return this.authHttp.get(this.cfg.apiUrl + this.cfg.books) 21 | .toPromise() 22 | .then(rs => { 23 | return rs.json(); 24 | }); 25 | } 26 | 27 | getOne(id: number) { 28 | return this.authHttp.get(this.cfg.apiUrl + this.cfg.books + '/' + id) 29 | .toPromise() 30 | .then(rs => { 31 | console.log(rs, rs.json()); 32 | return rs.json().book; 33 | }); 34 | } 35 | 36 | add(book: BookModel) { 37 | return this.authHttp.post(this.cfg.apiUrl + this.cfg.books, book) 38 | .toPromise() 39 | .then(() => { 40 | return true; 41 | }) 42 | .catch(e => console.log("create book error", e)); 43 | } 44 | 45 | update(book: BookModel) { 46 | return this.authHttp.put(this.cfg.apiUrl + this.cfg.books + '/' + book.id, book) 47 | .toPromise() 48 | .then(rs => { 49 | console.log(rs, rs.json()); 50 | return rs.json(); 51 | }) 52 | .catch(e => console.log("update book error", e)); 53 | } 54 | 55 | remove(id: number) { 56 | return this.authHttp.delete(this.cfg.apiUrl + this.cfg.books + '/' + id) 57 | .toPromise() 58 | .then(rs => { 59 | console.log(rs, rs.json()); 60 | return rs.json(); 61 | }) 62 | .catch(e => console.log("delete book error", e)); 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /src/service-worker.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Check out https://googlechrome.github.io/sw-toolbox/ 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; 31 | -------------------------------------------------------------------------------- /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: #488aff, 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 "ionic.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 | --------------------------------------------------------------------------------