Eksperymentuję z formularzami w Angular 2 RC4. To wszystko działa poprawnie, ale kiedy uruchomić aplikację konsoli przeglądarka daje mi tę wiadomość:Formularze w Angular 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.
Odpowiednia część mojego komponentu wygląda następująco:
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);
});
}
}
I odpowiedniej części mojego szablonu wygląda następująco:
<form [formGroup]="filterForm">
<div>
<label for="title">Title</label>
<input [formControl]="filterForm.controls['title']" id="title" />
</div>
</form>
Czy ktoś tu wie, co jest nowe formy moduł ostrzegawczy mówisz i dyrektywami, które będą zmieniać i na co?
Siema korzystania słowa "REACTIVE_FORM_DIRECTIVES" tutaj? –