I need you to check a checkbox, this will take you to a page.
But I get an error: funcion is not defined
MY CODE
home.html
<ion-header>
<ion-navbar>
<ion-title>
Selecciona tu ciudad
</ion-title>
</ion-navbar>
</ion-header>
<ion-content >
<ion-list>
<ion-item>
<ion-label>Concepcion del Uruguay</ion-label>
<ion-checkbox onclick="funcion()" type="checkbox" id="cdelu"></ion-checkbox>
</ion-item>
</ion-list>
</ion-content>
and my home.ts PD: The error occurs here
import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
import { CdeluPage } from '../cdelu/cdelu'
@Component({
selector: 'page-home',
templateUrl: 'home.html'
})
export class HomePage {
constructor(public navCtrl: NavController) {
function funcion(){ //Aqui esta el error
var checkbox = document.getElementById("cdelu") as HTMLInputElement;
if (checkbox.checked == true){
this.navCtrl.push(CdeluPage);
}
}
}
}