title: How to fix the Error "Type 'unknown[]' is not assignable to type 'Product[]'"
body: <p>Following a course made in Angular 4 while i'm using the latest version and i can't for the life of me figure out this problem.
  i am getting an error in <code>products.component.ts</code> when trying to filter the products.</p>
  
  <p>any help would be appreciated, i'm still new and this is my fourth day learning Angular.</p>
  
  <pre><code>Type 'unknown[]' is not assignable to type 'Product[]'. 
  Type '{}' is missing the following properties from type 'Product': title, price, category, imageUrl
  </code></pre>
  
  <p><strong>product.ts</strong></p>
  
  <pre><code>export interface Product {
      title: string;
      price: number;
      category: string;
      imageUrl: string;
  }
  
  </code></pre>
  
  <p><strong>product.service.ts</strong></p>
  
  <pre><code>import { map } from 'rxjs/operators';
  import { AngularFireDatabase } from 'angularfire2/database';
  import { Injectable } from '@angular/core';
  import { Product } from './models/product';
  
  @Injectable({
    providedIn: 'root'
  })
  export class ProductService {
  
    constructor(private db: AngularFireDatabase) { }
  
    create(product) {
      return this.db.list('/products').push(product);
    }
  
  
  
    getAll(){
      return this.db.list('/products').snapshotChanges()
        .pipe(
          map(actions =&gt;
            actions.map(a =&gt; ({ key: a.key, ...a.payload.val() }))
          )
        );
    }
  
    get(productId) {
      return this.db.object('/products/' + productId);
    }
  
    update(productId, product) {
      return this.db.object('/products/' + productId).update(product);
    }
  
    delete(productId)
    {
      return this.db.object('/products/' + productId).remove();
    }
  
  }
  </code></pre>
  
  <p><strong>products.component.ts</strong></p>
  
  <pre><code>import { ActivatedRoute } from '@angular/router';
  import { CategoryService } from './../category.service';
  import { ProductService } from './../product.service';
  import { Component, OnInit } from '@angular/core';
  import { Product } from '../models/product';
  import { Observable } from 'rxjs';
  
  @Component({
    selector: 'app-products',
    templateUrl: './products.component.html',
    styleUrls: ['./products.component.css']
  })
  export class ProductsComponent {
    products: Product[];
    categories$: Observable&lt;any[]&gt;;
    category: string;
    filteredProducts: Product[];
  
    constructor(
  
      productService: ProductService, 
      categoryService: CategoryService,
      route : ActivatedRoute) {
  
      productService.getAll().subscribe(a =&gt; this.products = a); //error on this.products: 
  
      //"Type 'unknown[]' is not assignable to type 'Product[]'."
      //  "Type '{}' is missing the following properties from type 'Product': title, price, category, imageUrl"
  
      this.categories$ = categoryService.getAll();
  
      route.queryParamMap.subscribe(params =&gt; {
  
        this.category = params.get('category');
  
        this.filteredProducts = (this.category) ?
        this.products.filter(p =&gt; p.category === this.category) : this.products;
  
      });
     }  
  }
  </code></pre>