├── typings └── index.d.ts ├── resources ├── icon.png ├── splash.png ├── ios │ ├── icon │ │ ├── icon.png │ │ ├── icon-40.png │ │ ├── icon-50.png │ │ ├── icon-60.png │ │ ├── icon-72.png │ │ ├── icon-76.png │ │ ├── icon@2x.png │ │ ├── icon-40@2x.png │ │ ├── icon-50@2x.png │ │ ├── icon-60@2x.png │ │ ├── icon-60@3x.png │ │ ├── icon-72@2x.png │ │ ├── icon-76@2x.png │ │ ├── icon-small.png │ │ ├── icon-small@2x.png │ │ └── icon-small@3x.png │ └── splash │ │ ├── Default-667h.png │ │ ├── Default-736h.png │ │ ├── Default~iphone.png │ │ ├── Default@2x~iphone.png │ │ ├── Default-568h@2x~iphone.png │ │ ├── Default-Landscape-736h.png │ │ ├── Default-Landscape~ipad.png │ │ ├── Default-Portrait~ipad.png │ │ ├── Default-Portrait@2x~ipad.png │ │ └── Default-Landscape@2x~ipad.png └── 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-port-hdpi-screen.png │ ├── drawable-port-ldpi-screen.png │ ├── drawable-port-mdpi-screen.png │ ├── drawable-land-xhdpi-screen.png │ ├── drawable-land-xxhdpi-screen.png │ ├── drawable-land-xxxhdpi-screen.png │ ├── drawable-port-xhdpi-screen.png │ ├── drawable-port-xxhdpi-screen.png │ └── drawable-port-xxxhdpi-screen.png ├── src ├── assets │ ├── icon │ │ └── favicon.ico │ ├── service-worker.js │ └── manifest.json ├── pages │ └── home │ │ ├── home.scss │ │ ├── home.html │ │ └── home.ts ├── app │ ├── main.dev.ts │ ├── main.prod.ts │ ├── app.component.ts │ └── app.module.ts ├── theme │ ├── global.scss │ └── variables.scss └── index.html ├── ionic.config.json ├── typings.json ├── tslint.json ├── .editorconfig ├── .gitignore ├── README.md ├── tsconfig.json ├── package.json └── config.xml /typings/index.d.ts: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /resources/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/ionic2rc0-firebase/HEAD/resources/icon.png -------------------------------------------------------------------------------- /resources/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/ionic2rc0-firebase/HEAD/resources/splash.png -------------------------------------------------------------------------------- /resources/ios/icon/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/ionic2rc0-firebase/HEAD/resources/ios/icon/icon.png -------------------------------------------------------------------------------- /src/assets/icon/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/ionic2rc0-firebase/HEAD/src/assets/icon/favicon.ico -------------------------------------------------------------------------------- /ionic.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ionicRel2Firebase", 3 | "app_id": "", 4 | "v2": true, 5 | "typescript": true 6 | } 7 | -------------------------------------------------------------------------------- /resources/ios/icon/icon-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/ionic2rc0-firebase/HEAD/resources/ios/icon/icon-40.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/ionic2rc0-firebase/HEAD/resources/ios/icon/icon-50.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/ionic2rc0-firebase/HEAD/resources/ios/icon/icon-60.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/ionic2rc0-firebase/HEAD/resources/ios/icon/icon-72.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/ionic2rc0-firebase/HEAD/resources/ios/icon/icon-76.png -------------------------------------------------------------------------------- /resources/ios/icon/icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/ionic2rc0-firebase/HEAD/resources/ios/icon/icon@2x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/ionic2rc0-firebase/HEAD/resources/ios/icon/icon-40@2x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-50@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/ionic2rc0-firebase/HEAD/resources/ios/icon/icon-50@2x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/ionic2rc0-firebase/HEAD/resources/ios/icon/icon-60@2x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/ionic2rc0-firebase/HEAD/resources/ios/icon/icon-60@3x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-72@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/ionic2rc0-firebase/HEAD/resources/ios/icon/icon-72@2x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/ionic2rc0-firebase/HEAD/resources/ios/icon/icon-76@2x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/ionic2rc0-firebase/HEAD/resources/ios/icon/icon-small.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-small@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/ionic2rc0-firebase/HEAD/resources/ios/icon/icon-small@2x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-small@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/ionic2rc0-firebase/HEAD/resources/ios/icon/icon-small@3x.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-667h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/ionic2rc0-firebase/HEAD/resources/ios/splash/Default-667h.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-736h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/ionic2rc0-firebase/HEAD/resources/ios/splash/Default-736h.png -------------------------------------------------------------------------------- /resources/ios/splash/Default~iphone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/ionic2rc0-firebase/HEAD/resources/ios/splash/Default~iphone.png -------------------------------------------------------------------------------- /resources/ios/splash/Default@2x~iphone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/ionic2rc0-firebase/HEAD/resources/ios/splash/Default@2x~iphone.png -------------------------------------------------------------------------------- /resources/android/icon/drawable-hdpi-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/ionic2rc0-firebase/HEAD/resources/android/icon/drawable-hdpi-icon.png -------------------------------------------------------------------------------- /resources/android/icon/drawable-ldpi-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/ionic2rc0-firebase/HEAD/resources/android/icon/drawable-ldpi-icon.png -------------------------------------------------------------------------------- /resources/android/icon/drawable-mdpi-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/ionic2rc0-firebase/HEAD/resources/android/icon/drawable-mdpi-icon.png -------------------------------------------------------------------------------- /resources/android/icon/drawable-xhdpi-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/ionic2rc0-firebase/HEAD/resources/android/icon/drawable-xhdpi-icon.png -------------------------------------------------------------------------------- /resources/android/icon/drawable-xxhdpi-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/ionic2rc0-firebase/HEAD/resources/android/icon/drawable-xxhdpi-icon.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-568h@2x~iphone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/ionic2rc0-firebase/HEAD/resources/ios/splash/Default-568h@2x~iphone.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-Landscape-736h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/ionic2rc0-firebase/HEAD/resources/ios/splash/Default-Landscape-736h.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-Landscape~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/ionic2rc0-firebase/HEAD/resources/ios/splash/Default-Landscape~ipad.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-Portrait~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/ionic2rc0-firebase/HEAD/resources/ios/splash/Default-Portrait~ipad.png -------------------------------------------------------------------------------- /resources/android/icon/drawable-xxxhdpi-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/ionic2rc0-firebase/HEAD/resources/android/icon/drawable-xxxhdpi-icon.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-Portrait@2x~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/ionic2rc0-firebase/HEAD/resources/ios/splash/Default-Portrait@2x~ipad.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-Landscape@2x~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/ionic2rc0-firebase/HEAD/resources/ios/splash/Default-Landscape@2x~ipad.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-land-hdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/ionic2rc0-firebase/HEAD/resources/android/splash/drawable-land-hdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-land-ldpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/ionic2rc0-firebase/HEAD/resources/android/splash/drawable-land-ldpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-land-mdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/ionic2rc0-firebase/HEAD/resources/android/splash/drawable-land-mdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-port-hdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/ionic2rc0-firebase/HEAD/resources/android/splash/drawable-port-hdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-port-ldpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/ionic2rc0-firebase/HEAD/resources/android/splash/drawable-port-ldpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-port-mdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/ionic2rc0-firebase/HEAD/resources/android/splash/drawable-port-mdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-land-xhdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/ionic2rc0-firebase/HEAD/resources/android/splash/drawable-land-xhdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-land-xxhdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/ionic2rc0-firebase/HEAD/resources/android/splash/drawable-land-xxhdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-land-xxxhdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/ionic2rc0-firebase/HEAD/resources/android/splash/drawable-land-xxxhdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-port-xhdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/ionic2rc0-firebase/HEAD/resources/android/splash/drawable-port-xhdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-port-xxhdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/ionic2rc0-firebase/HEAD/resources/android/splash/drawable-port-xxhdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-port-xxxhdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronksaunders/ionic2rc0-firebase/HEAD/resources/android/splash/drawable-port-xxxhdpi-screen.png -------------------------------------------------------------------------------- /src/pages/home/home.scss: -------------------------------------------------------------------------------- 1 | page-home { 2 | 3 | } 4 | 5 | .blockUIimg { 6 | max-width: 100%; 7 | max-height: 100%; 8 | } 9 | 10 | .blockUIParent { 11 | text-align: center; 12 | } -------------------------------------------------------------------------------- /src/app/main.dev.ts: -------------------------------------------------------------------------------- 1 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 2 | 3 | import { AppModule } from './app.module'; 4 | 5 | platformBrowserDynamic().bootstrapModule(AppModule); 6 | -------------------------------------------------------------------------------- /typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "firebase": "registry:npm/firebase#3.0.5+20160723033700" 4 | }, 5 | "globalDependencies": { 6 | "firebase": "file:node_modules/firebase/firebase.d.ts" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/assets/service-worker.js: -------------------------------------------------------------------------------- 1 | self.addEventListener('activate', function (event) { 2 | 3 | }); 4 | 5 | self.addEventListener('fetch', function (event) { 6 | 7 | }); 8 | 9 | self.addEventListener('push', function (event) { 10 | 11 | }); -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /src/app/main.prod.ts: -------------------------------------------------------------------------------- 1 | import { platformBrowser } from '@angular/platform-browser'; 2 | import { enableProdMode } from '@angular/core'; 3 | 4 | import { AppModuleNgFactory } from './app.module.ngfactory'; 5 | 6 | enableProdMode(); 7 | platformBrowser().bootstrapModuleFactory(AppModuleNgFactory); 8 | -------------------------------------------------------------------------------- /src/assets/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 | } -------------------------------------------------------------------------------- /.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 -------------------------------------------------------------------------------- /src/theme/global.scss: -------------------------------------------------------------------------------- 1 | // http://ionicframework.com/docs/v2/theming/ 2 | 3 | 4 | // Global CSS 5 | // -------------------------------------------------- 6 | // Put CSS rules here that you want to apply globally. 7 | // 8 | // To declare rules for a specific mode, create a child rule 9 | // for the .md, .ios, or .wp mode classes. The mode class is 10 | // automatically applied to the element in the app. 11 | // 12 | // App Shared Sass variables belong in app.variables.scss. 13 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ionic2rc0-firebase 2 | Updated 10/18/2017 - this is an basic app that I set up to get firebase working with Ionic RC1. 3 | 4 | ####Set Firebase3 Configuration Properties 5 | ```Javascript 6 | 7 | import firebase from 'firebase' 8 | 9 | // the firebase config 10 | const firebaseConfig = { 11 | apiKey: '', 12 | authDomain: '', 13 | databaseURL: '', 14 | storageBucket: '' 15 | }; 16 | ``` 17 | 18 | ####Modify `rollup.config.json` to resolve issues with Firebase 19 | ```Javascript 20 | useStrict: false, 21 | ``` 22 | -------------------------------------------------------------------------------- /src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { Platform } from 'ionic-angular'; 3 | import { StatusBar } from 'ionic-native'; 4 | 5 | import { HomePage } from '../pages/home/home'; 6 | 7 | 8 | @Component({ 9 | template: `` 10 | }) 11 | export class MyApp { 12 | rootPage = HomePage; 13 | 14 | constructor(platform: Platform) { 15 | platform.ready().then(() => { 16 | // Okay, so the platform is ready and our plugins are available. 17 | // Here you can do any higher level native things you might need. 18 | StatusBar.styleDefault(); 19 | }); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "typeRoots": [ 4 | "../node_modules/@types", 5 | "../node_modules/firebase" 6 | ], 7 | "types": [ 8 | "firebase" 9 | ], 10 | "allowSyntheticDefaultImports": true, 11 | "declaration": true, 12 | "emitDecoratorMetadata": true, 13 | "experimentalDecorators": true, 14 | "lib": [ 15 | "dom", 16 | "es2015" 17 | ], 18 | "module": "es2015", 19 | "moduleResolution": "node", 20 | "target": "es5" 21 | }, 22 | "exclude": [ 23 | "node_modules" 24 | ], 25 | "compileOnSave": false, 26 | "atom": { 27 | "rewriteTsconfig": false 28 | } 29 | } -------------------------------------------------------------------------------- /src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | 3 | import { NgModule } from '@angular/core'; 4 | import { IonicApp, IonicModule } from 'ionic-angular'; 5 | import { MyApp } from './app.component'; 6 | import { HomePage } from '../pages/home/home'; 7 | 8 | import firebase from 'firebase' 9 | 10 | // the firebase config 11 | const firebaseConfig = { 12 | apiKey: '', 13 | authDomain: '', 14 | databaseURL: '', 15 | storageBucket: '' 16 | }; 17 | 18 | @NgModule({ 19 | imports: [ 20 | BrowserModule, 21 | IonicModule.forRoot(MyApp) 22 | ], 23 | declarations: [ 24 | MyApp, 25 | HomePage 26 | ], 27 | bootstrap: [IonicApp], 28 | entryComponents: [ 29 | MyApp, 30 | HomePage 31 | ], 32 | providers: [] 33 | }) 34 | export class AppModule { 35 | 36 | constructor() { 37 | console.log() 38 | firebase.initializeApp(firebaseConfig) 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Ionic App 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ionic-hello-world", 3 | "author": "Ionic Framework", 4 | "homepage": "http://ionicframework.com/", 5 | "private": true, 6 | "scripts": { 7 | "build": "ionic-app-scripts build --dev", 8 | "watch": "ionic-app-scripts watch", 9 | "serve:before": "watch", 10 | "emulate:before": "build", 11 | "deploy:before": "build", 12 | "build:before": "build", 13 | "run:before": "build" 14 | }, 15 | "dependencies": { 16 | "@angular/common": "^2.0.0", 17 | "@angular/compiler": "^2.0.0", 18 | "@angular/compiler-cli": "0.6.2", 19 | "@angular/core": "^2.0.0", 20 | "@angular/forms": "^2.0.0", 21 | "@angular/http": "^2.0.0", 22 | "@angular/platform-browser": "^2.0.0", 23 | "@angular/platform-browser-dynamic": "^2.0.0", 24 | "@angular/platform-server": "^2.0.0", 25 | "@ionic/storage": "^1.0.3", 26 | "ionic-angular": "^2.0.0-rc.1", 27 | "ionic-native": "^2.2.3", 28 | "ionicons": "^3.0.0", 29 | "rxjs": "5.0.0-beta.12", 30 | "zone.js": "^0.6.21" 31 | }, 32 | "devDependencies": { 33 | "@ionic/app-scripts": "0.0.36", 34 | "typescript": "^2.0.3" 35 | }, 36 | "cordovaPlugins": [ 37 | "cordova-plugin-device", 38 | "cordova-plugin-console", 39 | "cordova-plugin-whitelist", 40 | "cordova-plugin-splashscreen", 41 | "cordova-plugin-statusbar", 42 | "ionic-plugin-keyboard" 43 | ], 44 | "cordovaPlatforms": [ 45 | "ios", 46 | { 47 | "platform": "ios", 48 | "version": "", 49 | "locator": "ios" 50 | } 51 | ], 52 | "description": "ionicRel2: An Ionic project" 53 | } 54 | -------------------------------------------------------------------------------- /src/theme/variables.scss: -------------------------------------------------------------------------------- 1 | // Ionic Variables and Theming. For more info, please see: 2 | // http://ionicframework.com/docs/v2/theming/ 3 | @import "ionic.globals"; 4 | 5 | 6 | // Shared Variables 7 | // -------------------------------------------------- 8 | // To customize the look and feel of this app, you can override 9 | // the Sass variables found in Ionic's source scss files. 10 | // To view all the possible Ionic variables, see: 11 | // http://ionicframework.com/docs/v2/theming/overriding-ionic-variables/ 12 | 13 | $text-color: #000; 14 | $background-color: #fff; 15 | 16 | 17 | // Named Color Variables 18 | // -------------------------------------------------- 19 | // Named colors makes it easy to reuse colors on various components. 20 | // It's highly recommended to change the default colors 21 | // to match your app's branding. Ionic uses a Sass map of 22 | // colors so you can add, rename and remove colors as needed. 23 | // The "primary" color is the only required color in the map. 24 | 25 | $colors: ( 26 | primary: #387ef5, 27 | secondary: #32db64, 28 | danger: #f53d3d, 29 | light: #f4f4f4, 30 | dark: #222, 31 | favorite: #69BB7B 32 | ); 33 | 34 | 35 | // App Theme 36 | // -------------------------------------------------- 37 | // Ionic apps can have different themes applied, which can 38 | // then be future customized. This import comes last 39 | // so that the above variables are used and Ionic's 40 | // default are overridden. 41 | 42 | @import "ionic.theme.default"; 43 | 44 | 45 | // Ionicons 46 | // -------------------------------------------------- 47 | // The premium icon font for Ionic. For more info, please see: 48 | // http://ionicframework.com/docs/v2/ionicons/ 49 | 50 | $ionicons-font-path: "../assets/fonts"; 51 | @import "ionicons"; 52 | -------------------------------------------------------------------------------- /config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | ionicRel2Firebase 4 | An awesome Ionic/Cordova app. 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 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /src/pages/home/home.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Ionic Blank 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 15 |
16 |
{{currentUser.auth?.displayName || currentUser.auth?.email}}
17 | 18 | 19 | 20 | 21 | 22 | {{item.name}} 23 | 24 | 25 |
26 | 27 |
28 |
29 | {{item.owner}} - {{ item.lastUpdated}} 30 |
31 |
32 |
33 |
34 |
35 | 36 | 37 | 38 | 39 | 40 |
41 | 42 |
43 |
44 | 45 | Username 46 | 48 | 49 | 50 |

51 | Username is required 52 |

53 | 54 | 55 | Password 56 | 57 | 58 | 59 |

60 | Password is required 61 |

62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 |

Error: {{ error.message }}

73 |
74 |
75 |
76 |
77 |
78 |
79 |
-------------------------------------------------------------------------------- /src/pages/home/home.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, NgZone } from '@angular/core'; 2 | import { Observable } from "rxjs/Observable"; 3 | import { NavController } from 'ionic-angular'; 4 | import firebase from 'firebase' 5 | 6 | @Component({ 7 | selector: 'page-home', 8 | templateUrl: 'home.html', 9 | }) 10 | 11 | export class HomePage implements OnInit { 12 | 13 | currentUser; 14 | error; 15 | authState; 16 | authChecked = false 17 | submitted = false; 18 | credentials: { email?: string, password?: string } = {}; 19 | 20 | assetList 21 | 22 | constructor( 23 | public navCtrl: NavController, 24 | private ngZone: NgZone) { 25 | } 26 | 27 | 28 | ngOnInit() { 29 | // subscribe to the auth object to check for the login status 30 | // of the user, if logged in, save some user information and 31 | // execute the firebase query... 32 | // .. otherwise 33 | // show the login modal page 34 | 35 | firebase.auth().onAuthStateChanged((_currentUser) => { 36 | 37 | this.ngZone.run(() => { 38 | if (_currentUser) { 39 | console.log("in auth subscribe", _currentUser) 40 | this.currentUser = _currentUser; 41 | 42 | this.assetList = this.doShowList(); 43 | 44 | } else { 45 | this.currentUser = null 46 | } 47 | 48 | this.authChecked = true; 49 | }); 50 | 51 | }) 52 | } 53 | 54 | doLogout() { 55 | firebase.auth().signOut().then(function () { 56 | // Sign-out successful. 57 | }, (error) => { 58 | this.error = error 59 | console.log(error); 60 | }); 61 | } 62 | 63 | doLogin(_credentials) { 64 | this.submitted = true; 65 | this.error = null 66 | 67 | if (_credentials.valid) { 68 | firebase.auth().signInWithEmailAndPassword(_credentials.value.email, _credentials.value.password) 69 | .then((_auth) => { 70 | console.log(_auth) 71 | }, (error) => { 72 | // Handle Errors here. 73 | this.error = error 74 | console.log(error); 75 | }); 76 | } 77 | } 78 | 79 | doShowList() { 80 | 81 | console.log("in doShowList"); 82 | try { 83 | return new Observable(observer => { 84 | 85 | var ref = firebase.database().ref('assets') 86 | 87 | ref.orderByKey().once('value', (snapshot) => { 88 | var arr = [] 89 | 90 | console.log("in doShowList Loop"); 91 | 92 | snapshot.forEach((childSnapshot) => { 93 | var data = childSnapshot.val() 94 | data['id'] = childSnapshot.key 95 | arr.push(data); 96 | 97 | console.log(data); 98 | return false; 99 | }); 100 | console.log(arr); 101 | 102 | observer.next(arr) 103 | observer.complete() 104 | }, 105 | (error) => { 106 | console.log("ERROR:", error) 107 | observer.error(error) 108 | }); 109 | }); 110 | 111 | } catch (EE) { 112 | console.log(EE) 113 | } 114 | } 115 | 116 | 117 | } 118 | --------------------------------------------------------------------------------