I recently developed a new Ionic application and encountered an issue while attempting to display a variable value in the HTML.
Without making any modifications, this is the current state of my page after creating the app.
import { IonicModule } from '@ionic/angular';
import { RouterModule } from '@angular/router';
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { Tab1Page } from './tab1.page';
import { SongsProviderService } from '../Services/songs-provider.service';
@NgModule({
imports: [
IonicModule,
CommonModule,
FormsModule,
RouterModule.forChild([{ path: '', component: Tab1Page }])
],
declarations: [Tab1Page]
})
export class Tab1PageModule {
songs: any;
bla: any;
constructor(public songsService: SongsProviderService) {
this.bla = "sss";
console.log(this.bla);
}
}
HTML:
<ion-header>
<ion-toolbar>
<ion-title>
Tab One
</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
<ion-content>
<p>Test {{bla}}</p>
</ion-content>
</ion-content>