View auth.service.ts
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; |
View auth.service.ts
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; |
View index.js
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']; |
View reverse.pipe.ts
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> |
View example.ts
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', |
View search-ui.html
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> |
View app.state.ts
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 {} |
View send-email.component.html
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> |
View search-ui.component.html
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"> |
View ref.ts
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