I tried the following:
HTML:
<button (click)="openAddPage()">
<ion-icon name="add"></ion-icon>
</button>
JS:
import {Page, NavController} from 'ionic-angular'
import {AddPage} from '../add/add'
@Page({
templateUrl: 'build/pages/lamps/lamps.html'
})
export class LampsPage {
constructor(nav: NavController) {
this.nav = nav
}
openAddPage() {
this.nav.push(AddPage)
}
}
But when running ionic serve
I get the following error:
SyntaxError: /path/to/app/pages/lamps/lamps.js: Unexpected token (9:17) while parsing file: /path/to/app/pages/lamps/lamps.js