Could you please help me in having this angular directive corrected for Jquery pttimeselect timepicker plugin.
http://pttimeselect.sourceforge.net/doc/documentation.html
Plunker link: http://tinyurl.com/hr7lker
Currently i have directive as below ,but getting this error TypeError: Cannot read property 'options' of undefined
app.directive('timePicker', function($parse) {
return {
restrict : "C",
replace : true,
transclude : false,
compile : function(element, attrs) {
var modelAccessor = $parse(attrs.ngModel);
return function(scope, element, attrs, controller) {
var processChange = function(i) {
var time = i.val();
scope.$apply(function(scope) {
modelAccessor.assign(scope, time);
});
scope.$eval(attrs.ngChange);
};
element.ptTimeSelect({
onClose : processChange
});
scope.$watch(modelAccessor, function(val) {
element.val(val);
});
};
}
};
});