File

src/providers/quotation/quotation.ts

Index

Properties
Methods

Constructor

constructor(http: HttpClient)
Parameters :
Name Type Optional
http HttpClient No

Methods

addQuote
addQuote(name: string, amount: number)
Parameters :
Name Type Optional
name string No
amount number No
Returns : void
attempt
attempt()
Returns : void
getNumQuoteItems
getNumQuoteItems()
Returns : any
getQuoteList
getQuoteList()
Returns : {}
isQuoteStarted
isQuoteStarted()
Returns : boolean

Properties

Public http
http: HttpClient
Type : HttpClient
Private quoteList
quoteList: any[]
Type : any[]
Default value : []
Private quoteStarted
quoteStarted:
Default value : false
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';

/*
  Generated class for the QuotationProvider provider.

  See https://angular.io/guide/dependency-injection for more info on providers
  and Angular DI.
*/
@Injectable()
export class QuotationProvider {
  private quoteList: any[] = [];
  private quoteStarted = false;

  constructor(public http: HttpClient) {
    console.log('Hello QuotationProvider Provider');
  }
attempt()
{
  alert("aefwe");
}

  addQuote(name: string, amount: number) {
    const quote = {
      'name': name,
      'amount': amount
    };
    this.quoteList.push(quote);
    this.quoteStarted = true;
  }

  getNumQuoteItems() {
    return this.quoteList.length;
  }

  isQuoteStarted() {
    return this.quoteStarted;
  }

  getQuoteList() {
    return this.quoteList;
  }
}

result-matching ""

    No results matching ""