I have an time input , and a directive which I would like to have for custom validation. I would need to have both the start time and end time. So I pass two values using the models to the directive.
<input type="time" data-ng-model="activity.etime" data-ng-date="activity.stime, activity.etime" >
Here's my directive. When I try to access the second paramater, it gives me a undefined value ( first one is fine). Is this a wrong way to use pass two values to a directive?
app.directive('ngDate', function () {
'use strict';
return {
require: 'ngModel',
link: function (scope, element, attr, aCtrl) {
function myValidation(stime,etime) {
console.log(etime);
}
}
};
});
max-date=...andmin-date=...that can be used separately or in pair. The other way is to put data in attributes and useattrto read them or better toattr.$obervethem in that case you will havevalidate-date min-date="..." max-date="..."activityand pull outstimeandetimefrom the object