February 2017
Beginner to intermediate
294 pages
6h 9m
English
We are ready to create our first--empty--report template and save it to Firebase as an object. Clearly we need to do some modifications on the parent's component. So add the Firebase object and modify the previous templates property as follows:
//src/app/report/report.component.ts import {FirebaseListObservable, AngularFire} from "angularfire2"; import {ReportConfig} from "./report.config"; //... export class ReportComponent implements OnInit { private templates: FirebaseListObservable<any>; private items = []; constructor(af: AngularFire) { this.templates = af.database.list('/Report/templates'); } ngOnInit() { this.templates.subscribe(data => {this.items = data;}); } newReportTemplate() { this.templates.push(new ReportConfig('untitled333', ...Read now
Unlock full access