Add Type of input insertion in dynamically created input fields


#1

in Ionic2 Type Script application, if I’m adding input field dinamicaly on .html form, with some condition like check-box check of button click, this way:

  addFields() {
    this.inputArray.push({
      label: 'Price:',
      value: '',
    }, {
        label: 'Product:',
        value: '',
      });
  }

How to add Type of input insertion, which is type="text" or type="number" in .html case: <ion-input type="text" text-left [(ngModel)]="name"></ion-input>, seems this way it does not works:

  addFields() {
    this.inputArray.push({
      label: 'Price:',
      value: '',
      type: 'number'
    }, {
        label: 'Product:',
        value: '',
        type: 'number'
      });
  }