0.0.6 • Published 1 year ago

custom-angular-time-picker v0.0.6

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

Angular Custom Time Picker

This library was generated with Angular CLI version 15.0.0.

Installation

  1. Install package from npm.
    npm install custom-angular-time-picker --save

Usage

  1. Include CustomAngularTimePickerComponentModule into your application.
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { CustomAngularTimePickerComponentModule } from 'ng2-datepicker';

@NgModule({
  imports: [BrowserModule, CustomAngularTimePickerComponentModule],
  declarations: [AppComponent],
  bootstrap: [AppComponent]
})
export class AppModule {}
  1. And that's it, you can then use it in your component as ts file:
<form [formGroup]="addNewTime">
    <custom-angular-time-picker 
        [value]="addNewTime.value.workSheduleTime"
        (onChange)="handleOnTimeChange($event)" >
    </custom-angular-time-picker>
</form>
  1. And that's it, you can then use it in your component as html file:
import { ControlContainer, FormBuilder, FormGroup, FormGroupDirective } from '@angular/forms';

@Component({
  selector: 'ParentComponentName',
  templateUrl: '',
  styleUrls: [''],
  viewProviders: [{
    provide: ControlContainer,
    useExisting: FormGroupDirective
  }]
})

export class ParentComponentName implements OnInit {

    addNewTime!: FormGroup;

    constructor(private fb: FormBuilder){
    }

    initForm() {
        this.addNewTime = this.fb.group({
        'workSheduleTime': ['', Validators.required]
        })
    }

}

Run Demo

  1. Clone this repository.
git clone https://github.com/Nikunj1896/custom-angular-time-picker
  1. Install dependencies.
npm install
  1. Start the demo
ng serve
0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago