This file contains 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 { AngularFireAuth } from "angularfire2/auth"; | |
import { AngularFireDatabase } from "angularfire2/database"; | |
import * as firebase from 'firebase'; | |
import { BehaviorSubject } from 'rxjs/BehaviorSubject'; | |
export class User { | |
uid: string; | |
username:string; |
This file contains 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 { AngularFireAuth } from "angularfire2/auth"; | |
import { AngularFireDatabase } from "angularfire2/database"; | |
import * as firebase from 'firebase'; | |
import { BehaviorSubject } from 'rxjs/BehaviorSubject'; | |
export class User { | |
uid: string; | |
username:string; |
This file contains 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 functions = require('firebase-functions'); | |
const admin = require('firebase-admin'); | |
admin.initializeApp(functions.config().firebase); | |
const request = require('request-promise'); | |
const _ = require('lodash'); | |
// List of output languages. | |
const LANGUAGES = ['es', 'fr', 'ar']; |
This file contains 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
<div *ngFor="let item of listObservable | async | reverse"> | |
{{item?.whatever}} | |
</div> |
This file contains 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
createData() { | |
const data = { | |
name: 'Crane', | |
family: 'bird', | |
weight: 10, | |
endangered: false, | |
// composite keys | |
endangered_family: 'false_bird', |
This file contains 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
<div *ngFor="let hit of hits | async"> | |
{{hit | json}} | |
</div> |
This file contains 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
@State<AppStateModel>({ | |
name: 'app', | |
defaults: { | |
hello: '', | |
} | |
}) | |
export class AppState {} |
This file contains 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
<button (click)="sendEmail()">Send Email via Cloud Function</button> |
This file contains 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
<div id="search-box"> | |
<!-- SearchBox widget will appear here --> | |
</div> | |
<div id="stats"> | |
<!-- stats widget will appear here --> | |
</div> | |
<div id="hits"> | |
<!-- Hits widget will appear here --> | |
</div> | |
<div id="pagination"> |
This file contains 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
export class DocRef { | |
private ref: firebase.firestore.DocumentReference; | |
private stream; | |
constructor(private path: string) { | |
this.ref = firebase.firestore().doc(path); | |
this.stream = Observable.create(observer => { | |
this.ref.onSnapshot({ | |
next(doc) { | |
observer.next(doc); |
OlderNewer