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

154
Views
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 answers
Answer question

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