I'm trying to extend Angular Schema Form <https://github.com/Textalk/angular-schema-form/blob/master/docs/extending.md> with a datepicker field. Here's a Plunker demo <http://plnkr.co/edit/l1tBaZ?p=preview> that shows where I'm at. The custom field type is named kerpdate and there are two fields of this type in the demo, the first of which is mandatory and the second is optional.
Most of the files in this demo are dependencies, those which implement and register the datepicker field type are named kerpDate* and the code for the demo is in app.js. There are currently a couple of problems: - The optional date field is marked as invalid when it is blank - If you delete the contents of the required date field it is (correctly) shown as invalid, but it doesn't revert to a valid state until you choose a valid date for the second time. The template for the datepicker addon is kerpDate.html, which uses the kerp-date directive. This directive watches two dates: - scope.date - a Date object that represents the date shown in the view (datepicker) - scope.ngModel - a String object that represents the date stored in the ASF model When one of these dates changes, the directive validates the new date, and updates the other date if validation passes. Obviously there's something wrong with the validation logic, any suggestions for how I can fix the two problems above would be very welcome. -- You received this message because you are subscribed to the Google Groups "AngularJS" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
