<repo_name>Caiosilva8/Projeto2<file_sep>/src/app/index/index.page.ts
import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'app-index',
  templateUrl: './index.page.html',
  styleUrls: ['./index.page.scss'],
})
export class IndexPage implements OnInit {

  constructor() { }

  ngOnInit() {
  }


  slideOpts = {
    initialSlide:0,
    speed: 20,
    autoplay:true,
    loop: true,
    slidesPerView: 1,
   };

  
}<file_sep>/src/app/service/storage.service.ts
import { Injectable } from "@angular/core";
import { Pedido } from '../model/pedido';

@Injectable()
export class StorageService {


    setCart(obj: Pedido) {
        localStorage.setItem('carrinho', JSON.stringify(obj));
    }

    getCart(): Pedido {
        let p = new Pedido();

        let str = localStorage.getItem("carrinho");

        if(str!=null){
            return JSON.parse(str);
        }else{
            return null;
        }
    }
}