• Jobs
  • About Us
  • professionals
    • Home
    • Jobs
    • Courses and challenges
  • business
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

224
Views
agregue el atributo sucio al texto y la lista desplegable con [ngModelOptions]="{standalone: true}" en angular 8 (kendo)

Tengo algunas etiquetas de lista desplegable que vinculan datos dinámicos, por lo que necesito usar [ngModelOptions]="{standalone: true}". Sé que usar ngModelOption significa ignorar el atributo de formulario, ¿hay algo más que pueda agregar el atributo sucio al texto o la lista desplegable?

archivo HTML

 <form #form="ngForm"> <div #ngFor="let item of [].constructor(details.length); let i = index> <input [(ngModel)]="person[i].age" id="age" name="age" [ngModelOptions]="{standalone: true}"/> <kendo-dropdownlist [data]="personName" [(ngModel)]="person[i].name" id="name" name="name" [ngModelOptions]="{standalone: true}"></kendo-dropdownlist> </div> <input [(ngModel)]="city" id="city" name="city" /> <button (click)="checkDirty()">CHECK DIRTY</button> </form>

archivo mecanografiado

 @ViewChildren('form', {static: true}) public form: NgForm; details = ["one","two"]; personName=["A","B","C"]; city=""; person = [{"age":"", "name":""},{"age":"", "name":""}]; checkDirty(){ console.log(this.form.dirty); // when i type something in the city input, and click check dirty button, it return true // however, if i type anything in age input or select any value in name and click check dirty button, it always return false. }

Sé que agregar [ngModelOptions]="{standalone: true} básicamente significa ignorar el atributo en el formulario. ¿Hay alguna forma de agregar el atributo sucio manualmente para el nombre de la lista desplegable y la edad de entrada?

about 3 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recommend me some offers
I have an error