These are chat archives for angular/angular-2-ionic-2

17th
Oct 2016
johndiego
@johndiego
Oct 17 2016 01:32
Hi guys]
how i can used sqlite in ionic2?
this code from doc!
Dont work!
import { Component, ViewChild } from '@angular/core';

import { Platform, MenuController, Nav } from 'ionic-angular';

import { StatusBar,SQLite } from 'ionic-native';
import { Inicial } from '../pages/inicial/inicial';
import { Login } from '../pages/login/login';


@Component({
  templateUrl: 'app.html'
})
export class MyApp {
  @ViewChild(Nav) nav: Nav;

  // make HelloIonicPage the root (or first) page
  rootPage: any = Inicial;
  pages: Array<{title: string, component: any}>;

  constructor(public platform: Platform, public menu: MenuController) {
    this.initializeApp();
    this.pages = [
      { title: 'Leitura de Etiquetas', component: Inicial },
      { title: 'Login', component: Login }
    ];
  }

  initializeApp() {
    this.platform.ready().then(() => {

      StatusBar.styleDefault();
      let db = new SQLite();
      db.openDatabase({
      name: 'data.db',
      createFromLocation: 1,
      location: 'default' // the location field is required
      }).then(() => {
        db.executeSql('create table danceMoves(name VARCHAR(32))', {}).then(() => {

        }, (err) => {
          console.error('Unable to execute sql: ', err);
        });
      }, (err) => {
        console.error('Unable to open database: ', err);
      });
    });
  }

  openPage(page) {
    // close the menu when clicking a link from the menu
    this.menu.close();
    // navigate to the new page if it is not the current page
    this.nav.setRoot(page.component);
  }
}
Kyle Roach
@iRoachie
Oct 17 2016 01:33
You tried it on a device or simulator?
johndiego
@johndiego
Oct 17 2016 01:34
No
how i can used this
I 'm noob in ionic2
I need testing save data
in sqlite
Kyle Roach
@iRoachie
Oct 17 2016 01:38
You’ll have to test it on a real device or a simulator
johndiego
@johndiego
Oct 17 2016 01:38
How i can make this
in simulator
Kyle Roach
@iRoachie
Oct 17 2016 02:21
I reccommend you take a look at the gettign started guide :) http://ionicframework.com/docs/v2/getting-started/installation/
idanwebzi
@idanwebzi
Oct 17 2016 09:02
there is a solution for rtl in ionic components?
Jade
@zjhiphop
Oct 17 2016 09:06
Do u means layout from right to left by components?
idanwebzi
@idanwebzi
Oct 17 2016 09:09
yes.. dir=rtl
My current changes is when I change language I bind the dir on the index html and change it but it make it very diffuclt to control because there some components that not behave nice with that
Jade
@zjhiphop
Oct 17 2016 09:12
May be u should use other custom style instead of ‘dir: rtf’ to better reflow the components
dir: rtf’ - > 'dir: rtl’
Kevin Vavelin
@kevin_vavelin_twitter
Oct 17 2016 11:45
Hi there, I have a little weird problem in my app, I created a modal and call it from NavController using ModalController, but when the view pop I only have the html file name of my modal and nothing else, also the view who call my modal is not responding to anything because he know that there is a modal shown and we can't have any interaction anymore, someone can help me ?
Kyle Roach
@iRoachie
Oct 17 2016 13:56
@kevin_vavelin_twitter did you dismiss the modal?
Kevin Vavelin
@kevin_vavelin_twitter
Oct 17 2016 14:15
The dismiss method is written, but I can't use it because the modal is not shown
idanwebzi
@idanwebzi
Oct 17 2016 14:26
show some code
idanwebzi
@idanwebzi
Oct 17 2016 14:39
@iRoachie Do you know y ionViewLoaded not invoked? only ngOnInit is fire I saw the change log and there is not something related to the ionic lifecycle
Kyle Roach
@iRoachie
Oct 17 2016 14:39
@idanwebzi It’s been replaced by IonViewDidLoad
Kevin Vavelin
@kevin_vavelin_twitter
Oct 17 2016 14:42
@idanwebzi i posted on Ionic framework forum my code and the behavior I have let me found the link for you :)
idanwebzi
@idanwebzi
Oct 17 2016 14:52
view-controller.js:231 ModalCmp ionViewWillLoad error: No component factory found for NotficationPage
Antonio Gallo
@badpenguin
Oct 17 2016 21:29
Any idea about avoid repeating <ion-header><ion-title>{{title}}</ion-title></ion-header> on every page's template?
Kevin Vavelin
@kevin_vavelin_twitter
Oct 17 2016 22:52
No idea about my problem ?