Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

324
Vistas
How to get value on change or on input method in angular2 using bootstrap-colorpicker?

I am using angular-cli and bootstrap-colorpicker. I want to get the value while picking up a color from the colorpicker onchange / oninput method.

here is my html code:

<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>

in ts file:

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

This function works when I make an input directly in the input type. Using jQuery method onchange or oninput I am able to get value. But I want to use angular2 way.

Please suggest me to solve this situation.

Thanks and Regards

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

You can use [(ngModel)] just as anyother input

  <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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda