Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- </div>
- <ion-list>
- <ion-item>
- <ion-input type="text" placeholder="Nome" [(ngModel)]="entry.name" clearInput ></ion-input>
- </ion-item>
- <ion-item>
- <ion-input type="tel" name="phone" placeholder="Celular" [brmasker]="{phone: true}" [(ngModel)]="entry.celular" clearInput ></ion-input>
- </ion-item>
- </ion-list>
- <ion-item>
- <ion-textarea rows="3" cols="10" placeholder="Deixe aqui comentários e sugestões..." [(ngModel)]="entry.description"></ion-textarea>
- </ion-item>
- export class HomePage {
- this.account
- .addEntry(name)
- .then(() => console.log('registro inserido'));
- import { Injectable } from '@angular/core';
- //this.dropTables();
- this.createTables();
- this.insertBD(db);
- })
- .catch(e => console.error('error on load db', JSON.stringify(e)));
- this.dbConection.sqlBatch([
- "CREATE TABLE IF NOT EXISTS pesquisa( id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT);"
- ])
- .then(() => console.log('tables created successfully'))
- .catch(e => console.error('error on creating tables', JSON.stringify(e)));
- if (data.rows.item(0).qtd == 0) {
- db.sqlBatch([
- ['INSERT INTO pesquisa (name) VALUES (?)']
- ])
- .then(() => console.log('Dados pesquisa incluídos com sucesso!'))
- .catch(e => console.error('Erro ao incluir os dados default', e));
- }
- })
- .catch(e => console.error('Erro ao consultar a qtd em pesquisa', JSON.stringify(e)));
- this.dbConection.sqlBatch([
- ["DROP TABLE pesquisa"]
- ])
- .then(() => console.log('tables droped successfully'))
- .catch(e => console.error('error on drop tables', JSON.stringify(e)));
- this.nome = navParams.get('name');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement