title: Cannot read property 'items' of null
body: <p>Here, x is not being able to access the properties of ShoppingCart the error it shows is Property item does not exist on type {} I dont know where is mistake i have made which i am not being able to identified</p>
  
  <p>shopping-cart.ts</p>
  
  <pre><code>import { ShoppingCartItem } from './shopping-cart-item';
  import { Product } from './product';
  
  export class ShoppingCart {
      items: ShoppingCartItem[] = [];
  
  }
  </code></pre>
  
  <p>shopping-cart-service.ts</p>
  
  <pre><code>import { Injectable } from '@angular/core';
  import { AngularFireDatabase } from '@angular/fire/database';
  import { Observable } from 'rxjs/observable';
  import { Product } from './models/product';
  import { take } from 'rxjs/operators';
  import { map } from 'rxjs/operators';
  import { ShoppingCart } from './models/shopping-cart';
  
  @Injectable({
    providedIn: 'root'
  })
  export class ShoppingCartService {
    constructor(private db: AngularFireDatabase) { }
  async getCart(): Promise&lt;Observable&lt;ShoppingCart&gt;&gt; {
      const cartId = await this.getOrCreateCartId();
      return this.db.object('/shopping-carts/' + cartId).valueChanges()
        .pipe(map(x =&gt; new ShoppingCart(x.items)));
    }
  
  }
  </code></pre>