Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.65 KB | None | 0 0
  1. </div>
  2. <ion-list>
  3. <ion-item>
  4. <ion-input type="text" placeholder="Nome" [(ngModel)]="entry.name" clearInput ></ion-input>
  5. </ion-item>
  6. <ion-item>
  7. <ion-input type="tel" name="phone" placeholder="Celular" [brmasker]="{phone: true}" [(ngModel)]="entry.celular" clearInput ></ion-input>
  8. </ion-item>
  9. </ion-list>
  10. <ion-item>
  11. <ion-textarea rows="3" cols="10" placeholder="Deixe aqui comentários e sugestões..." [(ngModel)]="entry.description"></ion-textarea>
  12. </ion-item>
  13.  
  14. export class HomePage {
  15.  
  16. this.account
  17. .addEntry(name)
  18. .then(() => console.log('registro inserido'));
  19.  
  20. import { Injectable } from '@angular/core';
  21.  
  22. //this.dropTables();
  23. this.createTables();
  24. this.insertBD(db);
  25. })
  26. .catch(e => console.error('error on load db', JSON.stringify(e)));
  27.  
  28. this.dbConection.sqlBatch([
  29. "CREATE TABLE IF NOT EXISTS pesquisa( id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT);"
  30. ])
  31. .then(() => console.log('tables created successfully'))
  32. .catch(e => console.error('error on creating tables', JSON.stringify(e)));
  33.  
  34. if (data.rows.item(0).qtd == 0) {
  35. db.sqlBatch([
  36. ['INSERT INTO pesquisa (name) VALUES (?)']
  37. ])
  38. .then(() => console.log('Dados pesquisa incluídos com sucesso!'))
  39. .catch(e => console.error('Erro ao incluir os dados default', e));
  40. }
  41. })
  42. .catch(e => console.error('Erro ao consultar a qtd em pesquisa', JSON.stringify(e)));
  43.  
  44. this.dbConection.sqlBatch([
  45. ["DROP TABLE pesquisa"]
  46. ])
  47. .then(() => console.log('tables droped successfully'))
  48. .catch(e => console.error('error on drop tables', JSON.stringify(e)));
  49.  
  50. this.nome = navParams.get('name');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement