Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

359
Views
No se puede vincular a 'objetivo' ya que no es una propiedad conocida de 'div'

Recibo este error al implementar la función de colapso:

Error: errores de análisis de plantilla: no se puede vincular a 'objetivo' ya que no es una propiedad conocida de 'div'

aplicación.componente.html:

 <div *ngFor = "let ele of elements; let RowIndex = index"> {{ele.name}} <button data-toggle="collapse" data-target="#demo{{RowIndex}}">Toggle </button> <div id="demo{{RowIndex}}" class="collapse">Lorem Ipsum</div> </div>

Pero si simplemente uso data-target="#demo" , funciona bien. Pero cuando estoy vinculando {{RowIndex}} , muestra un error.

about 4 years ago · Santiago Trujillo
3 answers
Answer question

0

Te perdiste el enlace de propiedad

 <button data-toggle="collapse" [attr.data-target]="'#demo'+ RowIndex">Toggle </button> <button (click)="clickMe($event)">Toggle</button> clickMe(value){ value.srcElement.innerHTML="Clicked"; }
about 4 years ago · Santiago Trujillo Report

0

Use la sintaxis de enlace de atributos de angular.

Utilice uno de los siguientes:

 <button data-toggle="collapse" attr.data-target="#demo{{RowIndex}}">Toggle </button>

o

 <button data-toggle="collapse" [attr.data-target]="'#demo' + RowIndex">Toggle </button>
about 4 years ago · Santiago Trujillo Report

0

usar enlace de propiedad: attr.data-target="{{your-target}}"

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!