I've encountered a snag with Ionic 2. I'm trying to navigate to a new view by obtaining a reference/alias to the component page.
In my parent class (SettingsPage), this is how I attempt to push a new page :
<ion-item [navPush]="addon.settingsLandingClss">
{{ addon.name }}
<ion-icon name="arrow-forward" item-right></ion-icon>
</ion-item>
Here's the TypeScript code snippet for the parent class (SettingsPage) :
import * as Mapping from '[...]';
export class SettingsPage {
public addon: Mapping.AddonMapModel;
constructor() {
this.addon = Mapping.AddonMap;
}
}
I store the page component under the 'settingsLandingClss' key:
// Importing page component
import { MyComponentPage } from '...';
export interface AddonMapModel {
name: string,
settingsLandingClss: any
}
export const AddonMap = {
name: 'Test',
settingsLandingClss: MyComponentPage // <--- Reference to component page
}
Note: It works when I import MyComponentPage in my parent class.