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
initProfileData(): void { | |
this.store.take(1).subscribe(store => { | |
if (!store.profile.profileData) { | |
this.apiService.getProfileData().toPromise() | |
.then(data => { | |
this.store.dispatch(new profileActions.UpdateAction(data)); | |
}) | |
.catch(err => { | |
this.router.navigate(['/404']) | |
}); |
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 container = document.getElementById("container"); | |
function loadApp(app) { | |
container.innerHTML = ''; | |
var element = document.createElement(app); | |
element.onload = function (load) { | |
console.log('loaded', load); | |
}; |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Web components loader</title> | |
<link rel="import" href="./apps/angular-app.html"> | |
<link rel="import" href="./apps/react-app.html"> | |
</head> | |
<body> | |
<h1>Hello web-components</h1> |
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 admin = require('./node_modules/firebase-admin'); | |
const serviceAccount = require("./service-key.json"); | |
const data = require("./data.json"); | |
admin.initializeApp({ | |
credential: admin.credential.cert(serviceAccount), | |
databaseURL: "https://YOUR_DB.firebaseio.com" | |
}); |
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
.node: &node | |
image: node:7 | |
before_script: | |
- npm install | |
cache: | |
key: "$CI_COMMIT_REF_NAME" | |
paths: | |
- node_modules/ | |
stages: |
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
"scripts": { | |
"ng": "ng", | |
"start": "ng serve", | |
"build": "ng build", | |
"test": "ng test", | |
"lint": "ng lint", | |
"e2e": "ng e2e", | |
"predeploy": "firebase use --token $FIREBASE_DEPLOY_KEY $CI_ENVIRONMENT_SLUG", | |
"deploy": "firebase deploy --non-interactive --token $FIREBASE_DEPLOY_KEY" | |
} |
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
{ | |
"projects": { | |
"default": "ng-firebase-dev", | |
"develop": "ng-firebase-dev", | |
"production": "ng-firebase-241bb" | |
} | |
} |
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
{ | |
"database": { | |
"rules": { | |
".read": "true", | |
".write": "true" | |
} | |
}, | |
"hosting": { | |
"public": "dist", | |
"rewrites": [{ |
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
<ul> | |
<li *ngFor="let item of items | async"> | |
<input type="text" #updatetext [value]="item.text" /> | |
<button (click)="updateItem(item.key, updatetext.value)">Update</button> | |
<button (click)="deleteItem(item.key)">Delete</button> | |
</li> | |
</ul> | |
<input type="text" #newitem /> | |
<button (click)="addItem(newitem.value)">Add</button> | |
<button (click)="deleteEverything()">Delete All</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
import { Component } from '@angular/core'; | |
import { AngularFireDatabase, AngularFireList } from 'angularfire2/database'; | |
import { Observable } from 'rxjs/Observable'; | |
@Component({ | |
selector: 'app-root', | |
templateUrl: './app.component.html', | |
styleUrls: ['./app.component.css'] | |
}) | |
export class AppComponent { |