Comments (6)
Can you provide us a little bit of more details, provide code that we can reproduce.
from amazing-time-picker.
[Updated]
I added a new pull request to fix this - all changes are in the AtpDirective file:
https://github.com/owsolutions/amazing-time-picker/pull/51/files
I read this blog and basically just applied it to the directive: https://blog.angularindepth.com/never-again-be-confused-when-implementing-controlvalueaccessor-in-angular-forms-93b9eee9ee83
from amazing-time-picker.
having same issue in reactive forms, even after followed bam-dreymers answers
from amazing-time-picker.
I have merged the code since all builds are passing and there is no backward compatibility issue.
This will be available after 1.5.0 version, probably by 03 of March, when we deploy to npm.
Please open a new issue, if you still having problems for this.
from amazing-time-picker.
Hi guys, just installed the time-picker and have this problem as well. Formfield value is not updated in the component.
When is this going to be fixed?
from amazing-time-picker.
@Beni90 you have two options to make it works:
- Applying the "atp-time-picker" directive to the input field, e.g.:
<label for="time_picker" class="control-label">Time Picker</label>
<input id="time_picker" formControlName="time_picker" type="time" atp-time-picker>
- Setting the value of the corresponding form control. This is my case, where I had and input group (input field + button) and want to make both the input and the button opening the time-picker
@Component({
selector: 'form-time-picker',
styleUrls: ['./form-time-picker.component.scss'],
template: `
<ng-container [formGroup]="formGroup">
<label for="time_picker" class="control-label">Time Picker</label>
<div class="input-group mb-2" id="time_picker" (click)="open()">
<input id="time_picker"
formControlName="time_picker"
type="time"
value="{{selectedTime}}"/>
<div class="input-group-append">
<button type="button" class="btn btn-primary btn-icon input-group-text">
<i class="ion-ios-time-outline"></i>
</button>
</div>
</div>
</ng-container>
`,
})
export class FormTimePickerComponent {
@Input()
formGroup: FormGroup;
@Input()
config: TimePickerConfig;
selectedTime: string;
constructor(private atp: AmazingTimePickerService) {
}
open() {
const timePicker = this.atp.open(this.config.pickerConfig);
timePicker.afterClose().subscribe(time => {
this.selectedTime = time;
this.formGroup.controls[this.config.name].setValue(time);
});
}
}
from amazing-time-picker.
Related Issues (20)
- switch automatically to the minute screen after select hour HOT 3
- npm warns vulnerability HOT 1
- issue in Amazing Time Picker in Angular 7, with the bootstrap Modal HOT 2
- amazing-time-picker is not working with angular 8.1.0 and enableIvy HOT 1
- 404 with official documentation HOT 1
- Does not work with Angular 7.2 HOT 2
- @angular/http should be removed from dependencies?
- how can I change the text in the "OK" and "cancel" buttons HOT 1
- angular/core/core.d.ts, found version 4, expected 3
- Add Node 12 support
- Angular 8/9
- NullInjectorError: StaticInjectorError(AppModule)[AtpDirective -> ViewContainerRef]: StaticInjectorError(Platform: core)[AtpDirective -> ViewContainerRef]:
- Third Button option
- How to customize the css of this library HOT 1
- Is there any way to close the time picker after time out?
- Support Angualr 9? HOT 5
- Is developer still alive HOT 1
- amazing time picker is not supporting firefox
- Open/Visible Time Picker modal by default
- Remove node sass as it is going to be deprecated. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from amazing-time-picker.