27push 27 does not exist on type 27observable 3cany 3e 27

Solutions on MaxInterview for 27push 27 does not exist on type 27observable 3cany 3e 27 by the best coders in the world

showing results for - " 27push 27 does not exist on type 27observable 3cany 3e 27"
Maissane
03 Sep 2016
1import {Component} from '@angular/core';
2import { AngularFireDatabase } from 'angularfire2/database';
3
4@Component({
5    selector: 'app-root',
6    templateUrl: './app.component.html',
7    styleUrls: ['./app.component.css']
8})
9export class AppComponent {
10    courses$;
11    courseObservable;
12    authors$;
13    constructor(db: AngularFireDatabase) {
14        this.courseObservable = db.list('/courses');
15        this.courses$ = this.courseObservable.valueChanges();
16        this.authors$ = db.object('/authors/1').valueChanges();
17
18    }
19    add(course: HTMLInputElement) {
20        this.courseObservable.push(course.value);
21        course.value = '';
22    }
23}
24