0

My code can run well but I have no idea on how to display {{subjectParam}} in a column when user select the subject. The current result return the subject with comma like this > Mathematic, Science. Is there a way to return it in a column/table? Here are my code:

addSubject.html

<form>
 <ion-item>
  <ion-label floating>Choose Subject</ion-label>
   <ion-select [(ngModel)]="subjectParam" multiple="true" id="subject" name="subject">
    <ion-option value="Mathematic">Mathematic</ion-option>
    <ion-option value="Science">Science</ion-option>
   </ion-select>
 </ion-item>
</form>

<div>Subject   : {{subjectParam}}</div>

addSubject.ts

import { Component } from '@angular/core';
import { NavParams } from 'ionic-angular';

@Component({
    selector: 'page-addSubject',
    templateUrl: 'addSubject.html'
})

export class AddSubjectPage 
{
  subjectParam: string;

  constructor(public params: NavParams) {
    this.subjectParam = params.get('subjectParam');
  }

}
4

0 回答 0