添加构造函数参数时出现Ionic 4黑屏

时间:2019-05-08 16:59:09

标签: ionic4 formbuilder

import { FormBuilder} from '@angular/forms';

这有效:

constructor(
) { }

但这不起作用:

constructor(
    private formBuilder: FormBuilder 
) { }

在进行ionic serve时出现空白的白屏

1 个答案:

答案 0 :(得分:1)

尝试将此处提到的ReactiveForms添加到您的应用模块:

https://angular.io/guide/reactive-forms#step-1-registering-the-reactive-forms-module

import { ReactiveFormsModule } from '@angular/forms';

@NgModule({
  imports: [
    // other imports ...
    ReactiveFormsModule
  ],
})
export class AppModule { }