Modal within FormBuilder returns error

Hello everyone!

I would like to use a modal in my form. I am aware that I should add

static get parameters(){
        return [[NavController],[ViewController],[NavParams]];

How ever when I add this, to my form class, I get an error, “TypeError: is not a function”

Any idea how to fix this?

You need…

  1. ionic-angular beta 11

Follow this link if you already have an existing project.

  1. Install the new forms module

  2. Import FormBuilder from @angular/forms

import { FormBuilder } from '@angular/forms';
  1. Then inject it in the class
export class MyClass {
 static get parameters(){
        return [[NavController],[ViewController],[NavParams], [FormBuilder]];
  constructor(navCtrl, viewCtrl, navParams, formBuilder){
    this.formBuilder = formBuilder;

Thanks @mhartington.

I posted this with beta 10 installed, but have yet to try with beta 11. Hopefully it fixed the issue. Will update this post when I do!


Follow Up for Googlers:

I did not pursue this route. Instead, I moved my FormGroup into a service much like the Angular2 dynamic forms tutroial.

Its cleaner and more modular this way.