import {Component} from '@angular/core';

import {NavController, PopoverController} from 'ionic-angular';
import {PopoverPage} from './about-popover';
import {TranslateService} from 'ng2-translate';


@Component({
    selector: 'page-about',
    templateUrl: 'about.html'
})
export class AboutPage {
    items;

    
(public navCtrl: NavController,
                public popoverCtrl: PopoverController,
                private translate: TranslateService) {
        this.items = [
            {title: 'item1'},
            {title: 'item2'},
            {title: 'item3'},
            {title: 'item4'},
            {title: 'item5'},
            {title: 'item6'}
        ];
    }

    changeLang() {
        console.log("changeLang...");
        this.translate.setDefaultLang('en-US');
        this.translate.use('en-US');
        //this.translate.reloadLang("en-US");
    }

    presentPopover(event) {
        let popover = this.popoverCtrl.create(PopoverPage);
        popover.present({ev: event});
    }

    removeItem(item) {

        for (let i = 0; i < this.items.length; i++) {

            if (this.items[i] == item) {
                this.items.splice(i, 1);
            }

        }

    }

}

constructor