ich ein Eingabefeld auf der folgenden Basis haben:angular2 nicht Eingang deaktiviert basierend auf wahr oder falsch Bedingung
Wenn eine Änderung Radio Ich sehe, dass sich der Wert ändert, um wahr für falsch:
<pre> {{model_parameters_general.estimationmethod=='ew'}} </pre>
Also wow, warum wird die Eingabebox auf Basis von True für False deaktiviert?
<input [disabled]="model_parameters_general.estimationmethod=='ew'" [(ngModel)]="model_parameters_general.lambda"
formControlName="lambda" type="text" class="form-control">
EDIT:
In den Protokollen ich diese:
It looks like you're using the disabled attribute with a reactive form directive. If you set disabled to true
when you set up this control in your component class, the disabled attribute will actually be set in the DOM for
you. We recommend using this approach to avoid 'changed after checked' errors.
Example:
form = new FormGroup({
first: new FormControl({value: 'Nancy', disabled: true}, Validators.required),
last: new FormControl('Drew', Validators.required)
});
So verwende ich ein reaktives von in rc6.
stelle ich die anfängliche disable auf die folgende Liste:
this.myForm = fb.group({
lambda: new FormControl({value: .99, disabled: true}, Validators.required),
})
So schalte ich auf der Grundlage eines Toggle eines Funkeingangs?
wenn Sie das Tag-Formular verwenden, sollten Sie Attributnamen für Ihre Eingabe als auch –