Angular
- 10 ответов
- 0 вопросов
3
Вклад в тег
<p-multiSelect [options]="getFilteredData()" [(ngModel)]="textAuxiliaryAxis"
maxSelectedLabels=3 defaultLabel="Выберите параметр" filterPlaceHolder="Поиск" (onChange)="delGraph($event, 'auxiliary')">
</p-multiSelect>
<p-multiSelect [options]="chartData[indicators] | myCoolPipe: 'main' " [(ngModel)]="textAuxiliaryAxis"
maxSelectedLabels=3 defaultLabel="Выберите параметр" filterPlaceHolder="Поиск" (onChange)="delGraph($event, 'auxiliary')">
</p-multiSelect>
@Pipe( selector: 'myCoolPipe')
export class MyCoolPipe implements PipeTransform {
public transform(value: any, filter: string = ''): string {
if (value) {
return value.filter(v => v.axis !== filter);
}
}
writeValue(value: any) {
this.formControlName = value;
}
form.setValue({email: "email", password: 'passworddd'})
// или
form.patchValue({email: "email"})
this.filterForm.valueChanges
.pipe(
takeUntil(this._onDestroy$)
)
.subscribe((val) => {
console.log(val);
});
initForm() {
this.SignupReactiveForm = this.fb.group({
password: ['password', [
Validators.required,
Validators.pattern(/[A-z]/)
]
],
email: ['email', [
Validators.required, Validators.email
]
],
});
}
}