This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { BrowserModule } from '@angular/platform-browser'; | |
import { NgModule } from '@angular/core'; | |
import { FormsModule } from '@angular/forms'; | |
import { HttpModule } from '@angular/http'; | |
import { AppComponent } from './app.component'; | |
import { AngularFireModule } from 'angularfire2'; | |
import { AngularFireDatabaseModule } from 'angularfire2/database'; | |
import { AngularFireAuthModule } from 'angularfire2/auth'; | |
import { environment } from '../environments/environment'; | |
import { RegisterComponent } from './register/register.component'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component } from '@angular/core'; | |
import { AngularFireDatabase, FirebaseListObservable } from 'angularfire2/database'; | |
import { AF } from '../providers/af'; | |
import { HttpModule } from '@angular/http'; | |
import { Observable } from 'rxjs/Observable'; | |
import { AngularFireAuthModule, AngularFireAuth } from 'angularfire2/auth'; | |
@Component({ | |
selector: 'app-root', | |
templateUrl: './app.component.html', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Injectable} from "@angular/core"; | |
import { Observable } from 'rxjs/Observable'; | |
import { FirebaseObjectFactoryOpts } from "angularfire2/interfaces"; | |
import { AngularFireDatabaseModule, AngularFireDatabase, FirebaseListObservable, FirebaseObjectObservable } from 'angularfire2/database'; | |
import { AngularFireAuthModule, AngularFireAuth } from 'angularfire2/auth'; | |
import * as firebase from 'firebase/app'; | |
import { Headers, Http, RequestOptions } from '@angular/http'; | |
import 'rxjs/add/operator/toPromise'; | |
@Injectable() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component } from '@angular/core'; | |
import { AngularFireDatabase, FirebaseListObservable } from 'angularfire2/database'; | |
import { AF } from '../providers/af'; | |
import { HttpModule } from '@angular/http'; | |
import { Observable } from 'rxjs/Observable'; | |
import { AngularFireAuthModule, AngularFireAuth } from 'angularfire2/auth'; | |
@Component({ | |
selector: 'app-root', | |
templateUrl: './app.component.html', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
<h2>Example 1</h2> | |
<button (click)="createNewUserHit($event)">Create a user via backend</button> | |
<button (click)="signInEmailPassHit($event)">Sign in using email and pass</button> | |
... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const router = express.Router(); | |
const admin = require('firebase-admin'); | |
const db = admin.database(); | |
... | |
router.use('/create-user', (req, res) => { | |
console.log('createUser: req', req.body); | |
admin.auth().createUser({ | |
email: req.body.emailAddress, | |
emailVerified: false, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
getTokenAndSendToAPI() { | |
this.afAuth.auth.currentUser.getToken().then(idToken => { | |
this.tokenID = idToken; | |
console.log('getTokenAndSendToAPI() idToken', this.tokenID); | |
let headersObj = new Headers(); | |
headersObj.append('Authorization', 'Bearer ' + this.tokenID) | |
let options = new RequestOptions({ headers: headersObj }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
router.use('/api', cors(), firebaseMiddleware.auth); | |
router.get('/api/hello', (req, res) => { | |
res.json({ | |
message: `You're logged in as ${res.locals.user.email} with Firebase UID: ${res.locals.user.uid}` | |
}); | |
}); | |
... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const webpack = require('webpack'); | |
const ExtractTextPlugin = require('extract-text-webpack-plugin'); | |
const UglifyJSPlugin = require('uglifyjs-webpack-plugin'); | |
const path = require('path'); | |
let prod = process.argv.indexOf('-p') !== -1; | |
let watchOption = process.argv.indexOf('--watch') !== -1; | |
module.exports = { | |
entry: ['./js/site.js'], | |
output: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var SURNAME = ["Abraham", "Allan", "Alsop", "Anderson", "Arnold", "Avery", "Bailey", "Baker", "Ball", "Bell", "Berry", "Black", "Blake", "Bond", "Bower", "Brown", "Buckland", "Burgess", "Butler", "Cameron", "Campbell", "Carr", "Chapman", "Churchill", "Clark", "Clarkson", "Coleman", "Cornish", "Davidson", "Davies", "Dickens", "Dowd", "Duncan", "Dyer", "Edmunds", "Ellison", "Ferguson", "Fisher", "Forsyth", "Fraser", "Gibson", "Gill", "Glover", "Graham", "Grant", "Gray", "Greene", "Hamilton", "Hardacre", "Harris", "Hart", "Hemmings", "Henderson", "Hill", "Hodges", "Howard", "Hudson", "Hughes", "Hunter", "Ince", "Jackson", "James", "Johnston", "Jones", "Kelly", "Kerr", "King", "Knox", "Lambert", "Langdon", "Lawrence", "Lee", "Lewis", "Lyman", "MacDonald", "Mackay", "Mackenzie", "MacLeod", "Manning", "Marshall", "Martin", "Mathis", "May", "McDonald", "McLean", "McGrath", "Metcalfe", "Miller", "Mills", "Mitchell", "Morgan", "Morrison", "Murray", "Nash", "Newman", "Nolan", "North", "Ogden", "Oliver", "Paige", "Parr" |
OlderNewer