Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

101
Visualizações
Angular2 ClockPicker

I am currently exploring all alternatives of clockpicker for a web app working with Angular 2

Something like http://weareoutman.github.io/clockpicker/ for exemple.

I have made researches but everything seems not easy to set up.

Has anyone came across any good solution ?

Thanks !

about 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

1st step

Use angular client (https://github.com/angular/angular-cli) to create a new project:

ng new clockpicker-example

2nd step

Install necessary packages:

npm install jquery --save-dev

npm install jquery --save-dev

npm install clockpicker --save-dev

npm install @types/clockpicker --save-dev

3rd step

Inside .angular-cli.json:

"styles": [
    "styles.css",
    "../node_modules/bootstrap/dist/css/bootstrap.min.css",
    "../node_modules/clockpicker/dist/bootstrap-clockpicker.min.css"
 ],
 "scripts": [
    "../node_modules/jquery/dist/jquery.min.js",
    "../node_modules/bootstrap/dist/js/bootstrap.min.js",
    "../node_modules/clockpicker/dist/bootstrap-clockpicker.min.js"
  ],

4th step

create a file called clockpicker.directive.ts

import {Directive, ElementRef, OnInit} from "@angular/core";
@Directive({
   selector: '[appClockPicker]'
})


export class ClockPickerDirective implements OnInit {
   constructor(private el: ElementRef) {}

   ngOnInit(): void {
     $(this.el.nativeElement).clockpicker({
       placement: 'bottom',
       align: 'left',
       donetext: 'Done',
       afterDone: () => {
         console.log('done');
       }
     });
   }
}

5th step

Inside app.component.html:

<div class="input-group" appClockPicker>
  <input type="text" class="form-control" value="09:30">
  <span class="input-group-addon">
    <span class="glyphicon glyphicon-time"></span>
  </span>
</div>

6th step

Inside typings.d.ts add:

declare var $: any;
declare var jQuery: any;
about 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda