├── .editorconfig ├── .gitignore ├── README.md ├── config.xml ├── ionic.config.json ├── package.json ├── resources ├── android │ ├── icon │ │ ├── drawable-hdpi-icon.png │ │ ├── drawable-ldpi-icon.png │ │ ├── drawable-mdpi-icon.png │ │ ├── drawable-xhdpi-icon.png │ │ ├── drawable-xxhdpi-icon.png │ │ └── drawable-xxxhdpi-icon.png │ └── splash │ │ ├── drawable-land-hdpi-screen.png │ │ ├── drawable-land-ldpi-screen.png │ │ ├── drawable-land-mdpi-screen.png │ │ ├── drawable-land-xhdpi-screen.png │ │ ├── drawable-land-xxhdpi-screen.png │ │ ├── drawable-land-xxxhdpi-screen.png │ │ ├── drawable-port-hdpi-screen.png │ │ ├── drawable-port-ldpi-screen.png │ │ ├── drawable-port-mdpi-screen.png │ │ ├── drawable-port-xhdpi-screen.png │ │ ├── drawable-port-xxhdpi-screen.png │ │ └── drawable-port-xxxhdpi-screen.png ├── icon.png ├── ios │ ├── icon │ │ ├── icon-40.png │ │ ├── icon-40@2x.png │ │ ├── icon-50.png │ │ ├── icon-50@2x.png │ │ ├── icon-60.png │ │ ├── icon-60@2x.png │ │ ├── icon-60@3x.png │ │ ├── icon-72.png │ │ ├── icon-72@2x.png │ │ ├── icon-76.png │ │ ├── icon-76@2x.png │ │ ├── icon-small.png │ │ ├── icon-small@2x.png │ │ ├── icon-small@3x.png │ │ ├── icon.png │ │ └── icon@2x.png │ └── splash │ │ ├── Default-568h@2x~iphone.png │ │ ├── Default-667h.png │ │ ├── Default-736h.png │ │ ├── Default-Landscape-736h.png │ │ ├── Default-Landscape@2x~ipad.png │ │ ├── Default-Landscape~ipad.png │ │ ├── Default-Portrait@2x~ipad.png │ │ ├── Default-Portrait~ipad.png │ │ ├── Default@2x~iphone.png │ │ └── Default~iphone.png └── splash.png ├── src ├── app │ ├── app.component.ts │ ├── app.module.ts │ ├── app.scss │ ├── main.dev.ts │ └── main.prod.ts ├── assets │ └── icon │ │ └── favicon.ico ├── components │ ├── login.component.ts │ └── logout.component.ts ├── declarations.d.ts ├── index.html ├── manifest.json ├── pages │ ├── auth │ │ ├── auth.html │ │ ├── auth.scss │ │ └── auth.ts │ ├── basic-demo │ │ ├── basic-demo.html │ │ ├── basic-demo.scss │ │ └── basic-demo.ts │ ├── home │ │ ├── home.html │ │ ├── home.scss │ │ └── home.ts │ └── tabs │ │ ├── tabs.html │ │ └── tabs.ts ├── providers │ ├── data │ │ └── data.service.ts │ └── user │ │ └── user.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 = 4 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 18 | -------------------------------------------------------------------------------- /.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 | # Firebase 3, Ionic 2 Demo 2 | 3 | **Note that this project has been entirely replaced with a new update that matches Ionic 2's RC2 release.** 4 | 5 | This project serves as a demo for how I integrated Firebase 3 into an Ionic 2 project. It includes basic database syncing, as well as Firebase user authentication. The goal was to create a demo app that could accompany [a blog post I wrote](https://webcake.co/using-firebase-3-in-angular-2-and-ionic-2/). 6 | 7 | ## Download and Installation 8 | 9 | ### Firebase Setup 10 | 11 | In order to set up this project, I had to previously create a Firebase app, following the steps outlined in their guide. Those steps are beyond the scope of the tutorial I wrote, and this demo begins at the point when: 12 | 13 | - [the Firebase app has been set up](https://console.firebase.google.com/) 14 | - [some data has been seeded](https://firebase.google.com/docs/database/web/structure-data) 15 | - [database rules have been revised](https://firebase.google.com/docs/database/security/) 16 | - [a demo user has been created](https://firebase.google.com/docs/auth/web/manage-users) 17 | 18 | You can find information on all of these topics in the [Web guide in the Firebase docs](https://firebase.google.com/docs/web/setup). 19 | 20 | **You're welcome to continue using my Firebase instance in running this demo**. Please don't overuse it, as I'm on the free tier and therefore only have a certain amount of requests and connections afforded to me every month. If you'd like to replace my Firebase account details with your own, instructions on how to do that are listed below. 21 | 22 | ### Repo Download 23 | 24 | When you clone this repo, it will come with nothing but the app files. You'll need to run through the installation process for building an Ionic project, which is normally done for you in `ionic start`. 25 | 26 | #### Environment 27 | 28 | Here's the output from my `ionic info` that allows me to run simulators and build appropriately for iOS: 29 | ``` 30 | Cordova CLI: 6.1.1 31 | Ionic Framework Version: 2.0.0-rc.2 32 | Ionic CLI Version: 2.1.8 33 | Ionic App Lib Version: 2.1.4 34 | Ionic App Scripts Version: 0.0.46 35 | ios-deploy version: 1.8.6 36 | ios-sim version: 4.1.1 37 | OS: OS X El Capitan 38 | Node Version: v6.2.1 39 | Xcode version: Xcode 7.3.1 Build version 7D1014 40 | ``` 41 | Keep in mind that - for whatever reason - this doesn't display any information about my Android stuff. Which, I mean, I dunno why. Anyway, here they are: 42 | 43 | - Android Studio 1.5.1 44 | - Android 5.1.1, API Level 22, Rev 2 45 | - Android SDK Build Tools 46 | - Android SDK Tools 24.3.3 47 | - Android SDK Platform-Tools 23.1 48 | 49 | #### Install Node Modules: 50 | ``` 51 | $ npm install 52 | ``` 53 | 54 | #### Make a `www/` Directory 55 | Yes, that sounds weird, but from my experience, as well as reading through [this issues post](https://github.com/driftyco/ionic-cli/issues/935) it looks like you'll need to create a `www/` directory in order for some Cordova-based commands to realize you're in a Cordova-based project. 56 | ``` 57 | $ mkdir www 58 | ``` 59 | 60 | #### Restore the Project State 61 | The folks at Ionic were nice enough to add a command that builds your project based on the plugin and platform information stored in the `package.json`: 62 | ``` 63 | $ ionic state restore 64 | ``` 65 | 66 | #### Add the Android Platform 67 | If you'd like, add Android. 68 | ``` 69 | $ ionic platform add android 70 | ``` 71 | 72 | ## Running the Project 73 | 74 | Provided you've followed the instructions above, and have an internet connection, you should be able to run the app, and see the stuffs. It's all coming from a demo app that I have set up on my Firebase dashboard, which has two seeded records, and one dummy user. 75 | 76 | ### iOS 77 | ``` 78 | # for some reason, I had to run this twice on the first go 79 | # maybe once to build, and once to serve? 80 | $ ionic run ios 81 | ``` 82 | 83 | ### Android 84 | ``` 85 | $ ionic run android 86 | ``` 87 | 88 | ## To Replace My Firebase App With Your Firebase App: 89 | 90 | - Seed the app with data that matches the following interface: 91 | ``` 92 | { 93 | static: string, 94 | private: string 95 | } 96 | ``` 97 | - Enable your application to use Email/Password authentication, on the **Sign In Method** tab of the Auth link in your app dashboard. 98 | - In the **Users** tab of the Auth link in your app dashboard, create a dummy user. 99 | - In the **Rules** tab of the Database link in your app dashboard, revise the default rules to match the following JSON: 100 | ``` 101 | { 102 | "rules": { 103 | ".read": "true", 104 | ".write": "auth != null", 105 | "private": { 106 | ".read": "auth != null" 107 | } 108 | } 109 | } 110 | ``` 111 | - In the app dashboard Home screen, click on the **Add Firebase to your web app** link, and copy the contents of the modal; then make your way to the `src/providers/data/data.service.ts` file of this repo, and replace the database details listed on lines 17-20 with the details from your database. 112 | 113 | Cake and grief counseling will be available at the conclusion of the test. 114 | -------------------------------------------------------------------------------- /config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | rc2-fb-demo 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 | -------------------------------------------------------------------------------- /ionic.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "rc2-fb-demo", 3 | "app_id": "", 4 | "v2": true, 5 | "typescript": true 6 | } 7 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "firebase-ionic2-demo", 3 | "author": "Colin J Lacy", 4 | "homepage": "http://webcake.co/", 5 | "private": true, 6 | "scripts": { 7 | "ionic:build": "ionic-app-scripts build", 8 | "ionic:serve": "ionic-app-scripts serve" 9 | }, 10 | "dependencies": { 11 | "@angular/common": "2.1.1", 12 | "@angular/compiler": "2.1.1", 13 | "@angular/compiler-cli": "2.1.1", 14 | "@angular/core": "2.1.1", 15 | "@angular/forms": "2.1.1", 16 | "@angular/http": "2.1.1", 17 | "@angular/platform-browser": "2.1.1", 18 | "@angular/platform-browser-dynamic": "2.1.1", 19 | "@angular/platform-server": "2.1.1", 20 | "@ionic/storage": "1.1.6", 21 | "firebase": "^3.6.1", 22 | "ionic-angular": "2.0.0-rc.2", 23 | "ionic-native": "2.2.3", 24 | "ionicons": "3.0.0", 25 | "rxjs": "5.0.0-beta.12", 26 | "zone.js": "0.6.21" 27 | }, 28 | "devDependencies": { 29 | "@ionic/app-scripts": "0.0.46", 30 | "typescript": "2.0.6" 31 | }, 32 | "cordovaPlugins": [ 33 | "cordova-plugin-whitelist", 34 | "cordova-plugin-statusbar", 35 | "cordova-plugin-console", 36 | "cordova-plugin-device", 37 | "cordova-plugin-splashscreen", 38 | "ionic-plugin-keyboard" 39 | ], 40 | "cordovaPlatforms": [ 41 | "ios", 42 | { 43 | "platform": "ios", 44 | "version": "", 45 | "locator": "ios" 46 | } 47 | ], 48 | "description": "rc2-fb-demo: An Ionic project" 49 | } 50 | -------------------------------------------------------------------------------- /resources/android/icon/drawable-hdpi-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinjlacy/firebase-ionic-2-demo/42528abd054c4cccdb4361717b33832f75fe7506/resources/android/icon/drawable-hdpi-icon.png -------------------------------------------------------------------------------- /resources/android/icon/drawable-ldpi-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinjlacy/firebase-ionic-2-demo/42528abd054c4cccdb4361717b33832f75fe7506/resources/android/icon/drawable-ldpi-icon.png -------------------------------------------------------------------------------- /resources/android/icon/drawable-mdpi-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinjlacy/firebase-ionic-2-demo/42528abd054c4cccdb4361717b33832f75fe7506/resources/android/icon/drawable-mdpi-icon.png -------------------------------------------------------------------------------- /resources/android/icon/drawable-xhdpi-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinjlacy/firebase-ionic-2-demo/42528abd054c4cccdb4361717b33832f75fe7506/resources/android/icon/drawable-xhdpi-icon.png -------------------------------------------------------------------------------- /resources/android/icon/drawable-xxhdpi-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinjlacy/firebase-ionic-2-demo/42528abd054c4cccdb4361717b33832f75fe7506/resources/android/icon/drawable-xxhdpi-icon.png -------------------------------------------------------------------------------- /resources/android/icon/drawable-xxxhdpi-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinjlacy/firebase-ionic-2-demo/42528abd054c4cccdb4361717b33832f75fe7506/resources/android/icon/drawable-xxxhdpi-icon.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-land-hdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinjlacy/firebase-ionic-2-demo/42528abd054c4cccdb4361717b33832f75fe7506/resources/android/splash/drawable-land-hdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-land-ldpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinjlacy/firebase-ionic-2-demo/42528abd054c4cccdb4361717b33832f75fe7506/resources/android/splash/drawable-land-ldpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-land-mdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinjlacy/firebase-ionic-2-demo/42528abd054c4cccdb4361717b33832f75fe7506/resources/android/splash/drawable-land-mdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-land-xhdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinjlacy/firebase-ionic-2-demo/42528abd054c4cccdb4361717b33832f75fe7506/resources/android/splash/drawable-land-xhdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-land-xxhdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinjlacy/firebase-ionic-2-demo/42528abd054c4cccdb4361717b33832f75fe7506/resources/android/splash/drawable-land-xxhdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-land-xxxhdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinjlacy/firebase-ionic-2-demo/42528abd054c4cccdb4361717b33832f75fe7506/resources/android/splash/drawable-land-xxxhdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-port-hdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinjlacy/firebase-ionic-2-demo/42528abd054c4cccdb4361717b33832f75fe7506/resources/android/splash/drawable-port-hdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-port-ldpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinjlacy/firebase-ionic-2-demo/42528abd054c4cccdb4361717b33832f75fe7506/resources/android/splash/drawable-port-ldpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-port-mdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinjlacy/firebase-ionic-2-demo/42528abd054c4cccdb4361717b33832f75fe7506/resources/android/splash/drawable-port-mdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-port-xhdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinjlacy/firebase-ionic-2-demo/42528abd054c4cccdb4361717b33832f75fe7506/resources/android/splash/drawable-port-xhdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-port-xxhdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinjlacy/firebase-ionic-2-demo/42528abd054c4cccdb4361717b33832f75fe7506/resources/android/splash/drawable-port-xxhdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-port-xxxhdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinjlacy/firebase-ionic-2-demo/42528abd054c4cccdb4361717b33832f75fe7506/resources/android/splash/drawable-port-xxxhdpi-screen.png -------------------------------------------------------------------------------- /resources/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinjlacy/firebase-ionic-2-demo/42528abd054c4cccdb4361717b33832f75fe7506/resources/icon.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinjlacy/firebase-ionic-2-demo/42528abd054c4cccdb4361717b33832f75fe7506/resources/ios/icon/icon-40.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinjlacy/firebase-ionic-2-demo/42528abd054c4cccdb4361717b33832f75fe7506/resources/ios/icon/icon-40@2x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinjlacy/firebase-ionic-2-demo/42528abd054c4cccdb4361717b33832f75fe7506/resources/ios/icon/icon-50.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-50@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinjlacy/firebase-ionic-2-demo/42528abd054c4cccdb4361717b33832f75fe7506/resources/ios/icon/icon-50@2x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinjlacy/firebase-ionic-2-demo/42528abd054c4cccdb4361717b33832f75fe7506/resources/ios/icon/icon-60.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinjlacy/firebase-ionic-2-demo/42528abd054c4cccdb4361717b33832f75fe7506/resources/ios/icon/icon-60@2x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinjlacy/firebase-ionic-2-demo/42528abd054c4cccdb4361717b33832f75fe7506/resources/ios/icon/icon-60@3x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinjlacy/firebase-ionic-2-demo/42528abd054c4cccdb4361717b33832f75fe7506/resources/ios/icon/icon-72.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-72@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinjlacy/firebase-ionic-2-demo/42528abd054c4cccdb4361717b33832f75fe7506/resources/ios/icon/icon-72@2x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinjlacy/firebase-ionic-2-demo/42528abd054c4cccdb4361717b33832f75fe7506/resources/ios/icon/icon-76.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinjlacy/firebase-ionic-2-demo/42528abd054c4cccdb4361717b33832f75fe7506/resources/ios/icon/icon-76@2x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinjlacy/firebase-ionic-2-demo/42528abd054c4cccdb4361717b33832f75fe7506/resources/ios/icon/icon-small.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-small@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinjlacy/firebase-ionic-2-demo/42528abd054c4cccdb4361717b33832f75fe7506/resources/ios/icon/icon-small@2x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-small@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinjlacy/firebase-ionic-2-demo/42528abd054c4cccdb4361717b33832f75fe7506/resources/ios/icon/icon-small@3x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinjlacy/firebase-ionic-2-demo/42528abd054c4cccdb4361717b33832f75fe7506/resources/ios/icon/icon.png -------------------------------------------------------------------------------- /resources/ios/icon/icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinjlacy/firebase-ionic-2-demo/42528abd054c4cccdb4361717b33832f75fe7506/resources/ios/icon/icon@2x.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-568h@2x~iphone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinjlacy/firebase-ionic-2-demo/42528abd054c4cccdb4361717b33832f75fe7506/resources/ios/splash/Default-568h@2x~iphone.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-667h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinjlacy/firebase-ionic-2-demo/42528abd054c4cccdb4361717b33832f75fe7506/resources/ios/splash/Default-667h.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-736h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinjlacy/firebase-ionic-2-demo/42528abd054c4cccdb4361717b33832f75fe7506/resources/ios/splash/Default-736h.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-Landscape-736h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinjlacy/firebase-ionic-2-demo/42528abd054c4cccdb4361717b33832f75fe7506/resources/ios/splash/Default-Landscape-736h.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-Landscape@2x~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinjlacy/firebase-ionic-2-demo/42528abd054c4cccdb4361717b33832f75fe7506/resources/ios/splash/Default-Landscape@2x~ipad.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-Landscape~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinjlacy/firebase-ionic-2-demo/42528abd054c4cccdb4361717b33832f75fe7506/resources/ios/splash/Default-Landscape~ipad.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-Portrait@2x~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinjlacy/firebase-ionic-2-demo/42528abd054c4cccdb4361717b33832f75fe7506/resources/ios/splash/Default-Portrait@2x~ipad.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-Portrait~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinjlacy/firebase-ionic-2-demo/42528abd054c4cccdb4361717b33832f75fe7506/resources/ios/splash/Default-Portrait~ipad.png -------------------------------------------------------------------------------- /resources/ios/splash/Default@2x~iphone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinjlacy/firebase-ionic-2-demo/42528abd054c4cccdb4361717b33832f75fe7506/resources/ios/splash/Default@2x~iphone.png -------------------------------------------------------------------------------- /resources/ios/splash/Default~iphone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinjlacy/firebase-ionic-2-demo/42528abd054c4cccdb4361717b33832f75fe7506/resources/ios/splash/Default~iphone.png -------------------------------------------------------------------------------- /resources/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinjlacy/firebase-ionic-2-demo/42528abd054c4cccdb4361717b33832f75fe7506/resources/splash.png -------------------------------------------------------------------------------- /src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { Platform } from 'ionic-angular'; 3 | import { StatusBar, Splashscreen } from 'ionic-native'; 4 | 5 | import { TabsPage } from '../pages/tabs/tabs'; 6 | import { DataService } from '../providers/data/data.service'; 7 | 8 | @Component({ 9 | //template: `COLIN` 10 | template: `` 11 | }) 12 | export class MyApp { 13 | rootPage: any = TabsPage; 14 | 15 | constructor(platform:Platform, data: DataService) { 16 | platform.ready().then(() => { 17 | data.init(); 18 | // Okay, so the platform is ready and our plugins are available. 19 | // Here you can do any higher level native things you might need. 20 | StatusBar.styleDefault(); 21 | Splashscreen.hide(); 22 | }); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { IonicApp, IonicModule } from 'ionic-angular'; 3 | 4 | import { MyApp } from './app.component'; 5 | import { BasicPage } from '../pages/basic-demo/basic-demo'; 6 | import { AuthPage } from '../pages/auth/auth'; 7 | import { LoginComponent } from '../components/login.component'; 8 | import { LogoutComponent } from '../components/logout.component'; 9 | import { HomePage } from '../pages/home/home'; 10 | import { TabsPage } from '../pages/tabs/tabs'; 11 | import { DataService } from '../providers/data/data.service'; 12 | import { UserService } from '../providers/user/user.service'; 13 | 14 | @NgModule({ 15 | declarations: [ 16 | MyApp, 17 | BasicPage, 18 | AuthPage, 19 | HomePage, 20 | TabsPage, 21 | LoginComponent, 22 | LogoutComponent 23 | ], 24 | imports: [ 25 | IonicModule.forRoot(MyApp) 26 | ], 27 | bootstrap: [IonicApp], 28 | entryComponents: [ 29 | MyApp, 30 | BasicPage, 31 | AuthPage, 32 | HomePage, 33 | TabsPage 34 | ], 35 | providers: [ 36 | DataService, 37 | UserService 38 | ] 39 | }) 40 | export class AppModule {} 41 | -------------------------------------------------------------------------------- /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/main.dev.ts: -------------------------------------------------------------------------------- 1 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 2 | 3 | import { AppModule } from './app.module'; 4 | 5 | platformBrowserDynamic().bootstrapModule(AppModule); 6 | -------------------------------------------------------------------------------- /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/icon/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinjlacy/firebase-ionic-2-demo/42528abd054c4cccdb4361717b33832f75fe7506/src/assets/icon/favicon.ico -------------------------------------------------------------------------------- /src/components/login.component.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by colinjlacy on 6/5/16. 3 | */ 4 | import { Component } from '@angular/core'; 5 | import { UserService } from '../providers/user/user.service'; 6 | 7 | @Component({ 8 | selector: 'login', 9 | template: ` 10 |

Login to see some stuff using these creds:

11 |
12 |
Email:
13 |
cave@aperture.com
14 |
Password:
15 |
notneverbutnow
16 |
17 |
18 | 19 | 20 | Email 21 | 23 | 24 | 25 | 26 | Password 27 | 29 | 30 | 31 |
32 | 33 |
34 |
` 35 | }) 36 | export class LoginComponent { 37 | public userEmail: string; 38 | public userPassword: string; 39 | 40 | constructor(private _user: UserService) {} 41 | 42 | public login() { 43 | this._user.login(this.userEmail, this.userPassword) 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/components/logout.component.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by colinjlacy on 6/5/16. 3 | */ 4 | import { Component } from '@angular/core'; 5 | import { UserService } from '../providers/user/user.service'; 6 | 7 | @Component({ 8 | selector: 'logout', 9 | template: ``, 10 | providers: [UserService] 11 | }) 12 | export class LogoutComponent { 13 | constructor(private _user: UserService) {} 14 | 15 | public logout() { 16 | this._user.logout() 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /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 | 22 | 23 | 24 | 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/pages/auth/auth.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Authentication Demo 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 |

Nicely done!

14 |

Your private message: {{message}}

15 |
16 | 17 |
18 |
19 |
20 | -------------------------------------------------------------------------------- /src/pages/auth/auth.scss: -------------------------------------------------------------------------------- 1 | .page3 { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /src/pages/auth/auth.ts: -------------------------------------------------------------------------------- 1 | import { Component, ChangeDetectorRef } from '@angular/core'; 2 | import { BehaviorSubject } from 'rxjs/Rx'; 3 | 4 | import { DataService } from '../../providers/data/data.service'; 5 | import { UserService } from '../../providers/user/user.service'; 6 | 7 | @Component({ 8 | templateUrl: './auth.html', 9 | }) 10 | export class AuthPage { 11 | public authStatus: boolean; 12 | public message: string; 13 | 14 | private privateData: BehaviorSubject; 15 | private isAuth: BehaviorSubject; 16 | 17 | constructor(private _data:DataService, private _user:UserService, private _cd:ChangeDetectorRef) { 18 | this.isAuth = new BehaviorSubject(false); 19 | this.privateData = new BehaviorSubject(''); 20 | 21 | this.isAuth.subscribe(val => this.authStatus = val); 22 | this.privateData.subscribe(val => this.message = val); 23 | } 24 | 25 | ionViewDidLoad() { 26 | this._user.auth.onAuthStateChanged(user => { 27 | this.isAuth.next(!!user); 28 | this._cd.detectChanges(); 29 | this._data.db.child('/private').on('value', data => { 30 | this.privateData.next(data.val()); 31 | this._cd.detectChanges(); 32 | }, err => console.log(err)); 33 | }); 34 | 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/pages/basic-demo/basic-demo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Basic Database Demo 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Message: {{message}} 13 | 14 | 15 | 16 | 17 | Direct Message, which comes from a direct reference to the DB child static: {{direct}} 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/pages/basic-demo/basic-demo.scss: -------------------------------------------------------------------------------- 1 | page-about { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /src/pages/basic-demo/basic-demo.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | import { DataService } from '../../providers/data/data.service'; 4 | 5 | @Component({ 6 | selector: 'page-basic-demo', 7 | templateUrl: 'basic-demo.html' 8 | }) 9 | export class BasicPage { 10 | 11 | public message: string; 12 | public direct: string; 13 | 14 | constructor(private _data: DataService) {} 15 | 16 | ionViewDidEnter() { 17 | // this can probably be improved with observables 18 | Promise.all([this.fetchMessage(), this.fetchDirect()]); 19 | } 20 | 21 | private fetchMessage() { 22 | return new Promise(res => { 23 | // this method... 24 | this._data.db.child('static').on('value', data => { 25 | this.message = data.val(); 26 | res(); 27 | }); 28 | }); 29 | } 30 | 31 | private fetchDirect() { 32 | return new Promise(res => { 33 | // ...fetches the same data as this method 34 | this._data.staticData.on('value', data => { 35 | this.direct = data.val(); 36 | res(); 37 | }); 38 | }); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/pages/home/home.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Intro 4 | 5 | 6 | 7 | 8 |

Firebase in Angular 2

9 | 10 |

If you're interested in the files that I've changed to integrate Firebase and get this simple auth example 11 | working, they're:

12 |
    13 |
  • 14 | providers/data/data.service.ts - sets up Firebase database references 15 |
  • 16 |
  • 17 | providers/user/user.service.ts - abstracts Firebase auth methods 18 |
  • 19 |
  • 20 | pages/home/ - the currently active component 21 |
      22 |
    • home.html - the template you're currently viewing
    • 23 |
    24 |
  • 25 |
  • 26 | pages/basic-demo/ - basic database demo 27 |
      28 |
    • basic-demo.html - sets up the template for displaying synced data
    • 29 |
    • basic-demo.ts - builds out the @Page for displaying synced data
    • 30 |
    31 |
  • 32 |
  • 33 | pages/auth/ - Firebase authentication demo 34 |
      35 |
    • auth.html - sets up the template for displaying user auth states
    • 36 |
    • auth.ts - builds out the @Page for integrating user auth states
    • 37 |
    38 |
  • 39 |
  • 40 | pages/tabs/tabs.html - revised tab titles 41 |
  • 42 |
  • 43 | components/ - components used for interacting with auth states 44 |
      45 |
    • 46 | login.component.ts - builds the login form, integrates the user service login 47 | function 48 |
    • 49 |
    • 50 | logout.component.ts - allows the user to logout, resetting the view to display the login form 51 |
    • 52 |
    53 |
  • 54 | 55 |
56 |
57 | -------------------------------------------------------------------------------- /src/pages/home/home.scss: -------------------------------------------------------------------------------- 1 | page-home { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /src/pages/home/home.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | import { NavController } from 'ionic-angular'; 4 | 5 | @Component({ 6 | selector: 'page-home', 7 | templateUrl: 'home.html' 8 | }) 9 | export class HomePage { 10 | 11 | constructor(public navCtrl: NavController) { 12 | 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/pages/tabs/tabs.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/pages/tabs/tabs.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | import { HomePage } from '../home/home'; 4 | import { BasicPage } from '../basic-demo/basic-demo'; 5 | import { AuthPage } from '../auth/auth'; 6 | 7 | @Component({ 8 | templateUrl: 'tabs.html' 9 | }) 10 | export class TabsPage { 11 | // this tells the tabs component which Pages 12 | // should be each tab's root Page 13 | tab1Root: any = HomePage; 14 | tab2Root: any = BasicPage; 15 | tab3Root: any = AuthPage; 16 | 17 | constructor() { 18 | 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/providers/data/data.service.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by colinjlacy on 6/5/16. 3 | */ 4 | import {Injectable} from '@angular/core'; 5 | 6 | import firebase from 'firebase'; 7 | 8 | @Injectable() 9 | export class DataService { 10 | public db: any; 11 | public staticData: any; 12 | public privateData: any; 13 | constructor() {} 14 | 15 | init() { 16 | const fbConf = { 17 | apiKey: "AIzaSyD44soNIK81xzRjQXZ2Lmlb03CBIx4zVY4", 18 | authDomain: "fir-app-f088c.firebaseapp.com", 19 | databaseURL: "https://fir-app-f088c.firebaseio.com", 20 | storageBucket: "fir-app-f088c.appspot.com" 21 | }; 22 | 23 | firebase.initializeApp(fbConf); 24 | 25 | this.db = firebase.database().ref('/'); 26 | this.staticData = firebase.database().ref('/static'); 27 | this.privateData = firebase.database().ref('/private'); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/providers/user/user.service.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by colinjlacy on 6/5/16. 3 | */ 4 | import {Injectable} from '@angular/core'; 5 | 6 | import firebase from 'firebase'; 7 | 8 | @Injectable() 9 | export class UserService { 10 | public auth: any; 11 | constructor() { 12 | this.auth = firebase.auth(); 13 | } 14 | 15 | public login(userEmail: string, userPassword: string) { 16 | return new Promise((resolve, reject) => { 17 | this.auth.signInWithEmailAndPassword(userEmail, userPassword) 18 | .then(userData => resolve(userData), 19 | err => reject(err)); 20 | }); 21 | } 22 | 23 | public logout() { 24 | return this.auth.signOut(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/service-worker.js: -------------------------------------------------------------------------------- 1 | // tick this to make the cache invalidate and update 2 | const CACHE_VERSION = 1; 3 | const CURRENT_CACHES = { 4 | 'read-through': 'read-through-cache-v' + CACHE_VERSION 5 | }; 6 | 7 | self.addEventListener('activate', (event) => { 8 | // Delete all caches that aren't named in CURRENT_CACHES. 9 | // While there is only one cache in this example, the same logic will handle the case where 10 | // there are multiple versioned caches. 11 | const expectedCacheNames = Object.keys(CURRENT_CACHES).map((key) => { 12 | return CURRENT_CACHES[key]; 13 | }); 14 | 15 | event.waitUntil( 16 | caches.keys().then((cacheNames) => { 17 | return Promise.all( 18 | cacheNames.map((cacheName) => { 19 | if (expectedCacheNames.indexOf(cacheName) === -1) { 20 | // If this cache name isn't present in the array of "expected" cache names, then delete it. 21 | console.log('Deleting out of date cache:', cacheName); 22 | return caches.delete(cacheName); 23 | } 24 | }) 25 | ); 26 | }) 27 | ); 28 | }); 29 | 30 | // This sample illustrates an aggressive approach to caching, in which every valid response is 31 | // cached and every request is first checked against the cache. 32 | // This may not be an appropriate approach if your web application makes requests for 33 | // arbitrary URLs as part of its normal operation (e.g. a RSS client or a news aggregator), 34 | // as the cache could end up containing large responses that might not end up ever being accessed. 35 | // Other approaches, like selectively caching based on response headers or only caching 36 | // responses served from a specific domain, might be more appropriate for those use cases. 37 | self.addEventListener('fetch', (event) => { 38 | 39 | event.respondWith( 40 | caches.open(CURRENT_CACHES['read-through']).then((cache) => { 41 | return cache.match(event.request).then((response) => { 42 | if (response) { 43 | // If there is an entry in the cache for event.request, then response will be defined 44 | // and we can just return it. 45 | 46 | return response; 47 | } 48 | 49 | // Otherwise, if there is no entry in the cache for event.request, response will be 50 | // undefined, and we need to fetch() the resource. 51 | console.log(' No response for %s found in cache. ' + 52 | 'About to fetch from network...', event.request.url); 53 | 54 | // We call .clone() on the request since we might use it in the call to cache.put() later on. 55 | // Both fetch() and cache.put() "consume" the request, so we need to make a copy. 56 | // (see https://fetch.spec.whatwg.org/#dom-request-clone) 57 | return fetch(event.request.clone()).then((response) => { 58 | 59 | // Optional: add in extra conditions here, e.g. response.type == 'basic' to only cache 60 | // responses from the same domain. See https://fetch.spec.whatwg.org/#concept-response-type 61 | if (response.status < 400 && response.type === 'basic') { 62 | // We need to call .clone() on the response object to save a copy of it to the cache. 63 | // (https://fetch.spec.whatwg.org/#dom-request-clone) 64 | cache.put(event.request, response.clone()); 65 | } 66 | 67 | // Return the original response object, which will be used to fulfill the resource request. 68 | return response; 69 | }); 70 | }).catch((error) => { 71 | // This catch() will handle exceptions that arise from the match() or fetch() operations. 72 | // Note that a HTTP error response (e.g. 404) will NOT trigger an exception. 73 | // It will return a normal response object that has the appropriate error code set. 74 | console.error(' Read-through caching failed:', error); 75 | 76 | throw error; 77 | }); 78 | }) 79 | ); 80 | }); -------------------------------------------------------------------------------- /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 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 | $ionicons-font-path: "../assets/fonts"; 72 | @import "ionicons"; 73 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "allowSyntheticDefaultImports": true, 4 | "declaration": true, 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 | "types": [ 23 | "firebase" 24 | ], 25 | "compileOnSave": false, 26 | "atom": { 27 | "rewriteTsconfig": false 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /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 | --------------------------------------------------------------------------------