Push product into an array model, controller

I also recommend not setting the value of products at the root level since this can lead to memory leaks especially in tests. Its been recommended to set its initial value in the init lifecycle method.

export default Controller.extend({
  appName: “ShoppingCart”, 
  products: null, 
  init() {
    this.set('products', []);
  },
  action: { 
    add(product) { 
      this.get('products').pushObject(product); 
    }
  }
});