Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70435

ngFor doesn't work

$
0
0

@bony wrote:

i just need to add some in ion-card header, here is the code

<ion-content>

<ion-row>

<ion-card style=“width:23.5%” *ngFor=“let subject of subjects”>

<ion-card-header>

<ion-card-subtitle>{{subjects.creator.name}}</ion-card-subtitle>

<ion-card-title>{{subject.name}}</ion-card-title>

</ion-card-header>

<ion-card-content>

Keep close to Nature’s heart… and break clear away, once in awhile,

and climb a mountain or spend a week in the woods. Wash your spirit clean.

</ion-card-content>

</ion-card>

</ion-row>

</ion-content>

import { NgModule, OnInit } from ‘@angular/core’;
import { CommonModule } from ‘@angular/common’;
import { IonicModule } from ‘@ionic/angular’;
import { FormsModule } from ‘@angular/forms’;
import { RouterModule } from ‘@angular/router’;

import { HomePage } from ‘./home.page’;
import { DataProvider } from ‘…/data/dataProvider’;
import { Subject } from ‘…/models/subject/subject-model’;

@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
RouterModule.forChild([
{
path: ‘’,
component: HomePage
}
])
],
declarations: [HomePage]
})

export class HomePageModule implements OnInit {
public subjects: Subject = ;

constructor (public dataProvider: DataProvider) {
this.subjects = this.dataProvider.getSubjects();
}

ngOnInit() {}

}

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70435

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>