角度2のRC4のフォームを試しています。 これは、すべての作業罰金だが、私は、アプリを起動したときに、ブラウザのコンソールは、私にこのメッセージを表示します。角度2のフォームRC4
私のコンポーネントの関連部分はこのようになります*It looks like you're using the old forms module. This will be opt-in in the next RC, and will eventually be removed in favor of the new forms module.
:
import {
FORM_DIRECTIVES,
REACTIVE_FORM_DIRECTIVES,
FormBuilder,
FormGroup
} from '@angular/forms';
import {Observable} from "rxjs/Rx";
@Component
({
selector: "hh-topbar",
moduleId: module.id,
templateUrl: "topBar.component.html",
directives: [HHPagerComponent, FORM_DIRECTIVES, REACTIVE_FORM_DIRECTIVES]
})
export class HHTopBarComponent implements OnChanges, OnInit
{
...
private filterForm: FormGroup;
private title$: Observable<string>;
constructor(private formBuilder: FormBuilder)
{
}
public ngOnInit(): any
{
this.filterForm = this.formBuilder.group
({
"title": [this.info.filters.searchFileName]
});
this.title$ = this.filterForm.controls["title"].valueChanges;
this.title$.subscribe(val =>
{
this.info.filters.searchFileName = val;
this.filterChanged.emit(this.info.filters);
});
}
}
をそして、私のテンプレートの関連部分次のようになります。
<form [formGroup]="filterForm">
<div>
<label for="title">Title</label>
<input [formControl]="filterForm.controls['title']" id="title" />
</div>
</form>
誰もがここで新しいフォームは警告が話しているとどのディレクティブが変更とどのようになりますモジュールが何であるかを知っていますか?
いただきまし利用をここでは「REACTIVE_FORM_DIRECTIVES」の? –