customers.ts 721 B

1234567891011121314151617181920212223242526272829303132
  1. import { Component } from "@angular/core";
  2. import { NavController, NavParams } from "ionic-angular";
  3. import { PouchService } from "../../services/pouch-service";
  4. @Component({
  5. selector: 'page-customers',
  6. templateUrl: 'customers.html'
  7. })
  8. export class CustomersPage {
  9. constructor(
  10. public navCtrl: NavController,
  11. public navParams: NavParams,
  12. public pouch: PouchService
  13. ) { }
  14. ionViewDidLoad() {
  15. console.log('ionViewDidLoad CustomersPage');
  16. this.loadCustomers();
  17. }
  18. /**
  19. *
  20. */
  21. loadCustomers(): void {
  22. this.pouch.getAll('res.partner').subscribe(results => {
  23. console.log(results.docs.shift().records);
  24. });
  25. }
  26. }