Q:

Type 'Observable<{}[]>' is not assignable to type 'BrandElement[]'. Property 'includes' is missing in type 'Observable<{}[]>'

I am using firebase for database. trying to get data and display it in angular 6 table.
This is interface and component class.    
export interface BrandElement {
  name: string;
  image: string;
}    

export class BrandComponent implements OnInit {

  displayedColumns = ['name'];
  //dataSource = new MatTableDataSource(ELEMENT_DATA);
  dataSource = new MatTableDataSource<BrandElement>();

    constructor(private _router: Router, private _af: AngularFireDatabase) { 
       this.dataSource.data = this._af.list('/all-brands').valueChanges();
   }
}

Line in the constructor giving error 
[ts]
Type 'Observable<{}[]>' is not assignable to type 'BrandElement[]'.
Property 'includes' is missing in type 'Observable<{}[]>'.

How to fix this issue?

A:

You can solve it in two ways, use  
 brandList: Observable<any[]>;

and then,
this.brandList=  this._af.list('/all-brands').valueChanges();

this.brandList.subscribe( (value) => {
  this.dataSource = new MatTableDataSource(value);
});

or cast your
 this.dataSource.data = this._af.list<BrandElement>('/all-brands').valueChanges();

