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

155
Views
Selector de reloj de Angular2

Actualmente estoy explorando todas las alternativas de clockpicker para una aplicación web que funcione con Angular 2

Algo como http://weareoutman.github.io/clockpicker/ por ejemplo.

He investigado, pero todo parece no ser fácil de configurar.

¿Alguien ha encontrado alguna buena solución?

Gracias !

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

1er paso

Use el cliente angular ( https://github.com/angular/angular-cli ) para crear un nuevo proyecto:

ng new clockpicker-example

2do paso

Instale los paquetes necesarios:

npm install jquery --save-dev

npm install jquery --save-dev

npm install clockpicker --save-dev

npm install @types/clockpicker --save-dev

3er paso

Dentro de .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" ],

4to paso

cree un archivo llamado 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'); } }); } }

5to paso

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

6to paso

Dentro typings.d.ts agregar:

 declare var $: any; declare var jQuery: any;
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!