Comments (8)
Hi @AKFourSeven, this seems to be related to #17.
Have you already tried the latest version of Angular Moment Picker?
from angular-moment-picker.
Nope I haven't, I will try updating and keep in touch with you.
from angular-moment-picker.
Hi after updating I can confirm that the issue is different, the problem still remains. It seems as though the calendar has been updated as well as the input , something prevent to trigger the watches on the form to set the element (and thus the form) to dirty.
I have been using this plugin for a while and never experienced that before (it might be because I never confronted the case).
from angular-moment-picker.
Ok, let's take this plunker.
Angular does not unset $pristine
property when a model has been changed through javascript, it sets the value to false
only when a user interacts with a given input.
That being said, I think that the best solution for you is to set the pristine state by yourself when model changes, using the native angular api $setDirty()
:
$scope.$watch('myDate', function (myDate) {
if (angular.isDefined(myDate)) {
form.myDate.$setDirty();
}
});
Check out this plunker: http://plnkr.co/edit/QhBoLzbHm48LGWrhhYb0?p=preview
from angular-moment-picker.
I see the angle you are tackling this from. But I cannot get the form object from within the link function.
I'll try to find a way to do that and post it here once I have found it, thanks for the tips though!
from angular-moment-picker.
If you have a directive with a link function maybe you need to check your scopes.
This is a very simple plunker that makes use of a directive with no private scope.
from angular-moment-picker.
I'm going to close this issue since it seems there's not due to Angular Moment Picker.
Feel free to reopen it if you find any problem.
from angular-moment-picker.
I haven't actually replicated this, but I am sure it is due to the fact that moment-picker does not use ngModel. ngModelCtrl methods handle setting pristine/dirty state.
from angular-moment-picker.
Related Issues (20)
- Deactivate two days, and for hours HOT 2
- BUG--> duplicate months when using moment time zone.
- The active year doesn't turn blue (highlight) when I use start-date
- datepicker closes when you click on navigation buttons in ionic v1 and angular 1.4
- Hour view after clicking day HOT 1
- Bootstrap 4 not working HOT 1
- How to show 5 columns in date picker
- 31st Day of Month not selecting properly with Custom Format.
- Is there a way to dynamically enable/disable days or hours
- Pop Up of moment-picker position is not fixed. HOT 1
- I cant update my moment picker from controller side HOT 1
- Duplicate hours when there is DST
- _d and _i are different from each other and are not the date I picked
- Set different start-view based on value
- Force picker to use new time zone
- ng-invalid is not set when the date is manually changed to an invalid value
- Inconsistency in hour and minute selector.
- moment picker calendar display issue in mobile view HOT 1
- Ignoring model changes if model is set to string HOT 1
- Build of master generates many ts errors
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 angular-moment-picker.