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

330
Views
¿Cómo obtener valor en el cambio o en el método de entrada en angular2 usando bootstrap-colorpicker?

Estoy usando angular-cli y bootstrap-colorpicker. Quiero obtener el valor al seleccionar un color del método de cambio / entrada del selector de color.

aquí está mi código html:

 <div id="cp2" class="input-group colorpicker-component"> <input id="colorInput" type="text" value="#00AABB" class="form-control textedit" data-type="color" (input)="testevent($event)" /> <span class="input-group-addon"><i></i></span> </div>

en el archivo ts:

 testevent(event){ console.log(event.target.value); }

Esta función funciona cuando hago una entrada directamente en el tipo de entrada. Usando el método jQuery onchange o oninput, puedo obtener valor. Pero quiero usar la forma angular2.

Por favor sugiérame para resolver esta situación.

Gracias y saludos

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Puede usar [(ngModel)] como cualquier otra entrada

 <input id="colorInput" type="text" [(ngModel)]="colorCode" value="#00AABB" class="form-control textedit" data-type="color" (change)="test()" /> test(){ console.log(this.colorCode); }
over 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!