title: How to convert hard coded array to Observable<T> in angular 6
body: <p>How can you convert an array to an observable array in angular 6.
  I am trying to return an observable while having an array. I'm doing this so that instead of an HTTP request I can return hard-coded data.</p>
  
  <p>I have the following interface:</p>
  
  <pre><code>export interface IProduct {
    productId: number;
    productName: string;
    productCode: string;
    releaseDate: string;
    description: string;
    price: number;
    starRating: number;
    imageUrl: string;
  }
  </code></pre>
  
  <p>Then I have this service: </p>
  
  <pre><code>export class ProductService {
  
    products: IProduct[];
  
    getProducts(): Observable&lt;IProduct[]&gt; {
      this.products = [
        {
          'productId': 2,
          'productName': 'Black cat',
          'productCode': 'GDN-001',
          'releaseDate': 'March 18, 2018',
          'description': 'Can punch peoples faces.',
          'price': 32.00,
          'starRating': 5,
          'imageUrl': 'https://placekitten.com/400/420'
        },
        {
          'productId': 3,
          'productName': 'T Cat',
          'productCode': 'GDN-002',
          'releaseDate': 'March 18, 2018',
          'description': 'Can shoot guns.',
          'price': 32.00,
          'starRating': 2.2,
          'imageUrl': 'https://placekitten.com/400/420'
        }
      ];
  
      //paste here how to return the array to observable
  
    }
  }
  </code></pre>