Recras / angular-jquery-timepicker

AngularJS directive for jQueryUI Timepicker
MIT License
53 stars 41 forks source link

ui-timepicker="timePickerOptions" doesn't work #10

Closed weicao closed 9 years ago

weicao commented 9 years ago

you cannot access other scope variables except those included in directive's scope, according to angular document https://docs.angularjs.org/guide/directive

after comment out these code, it works,

return { restrict: 'A', require: 'ngModel', // scope: { // ngModel: '=', // baseDate: '=', // },

btw, thanks for your great job

timmipetit commented 9 years ago

Hi, thanks for reporting this. We switched to an isolated scope to follow the Angular best practices. Can you give a use case when prototypical inherited scope would be better for you?

borislit commented 9 years ago

+1

On line 57 $parse(attrs.uiTimepicker)(scope) returns undefined. Pephaps, instead of using attrs, this should be passed using another scope variable (in addition to ngModal and baseDate)

timmipetit commented 9 years ago

Thanks for finding this issue! Indeed, it seems that passing custom options to uiTimePicker doesn't work at this moment. I will start working on a fix.

timmipetit commented 9 years ago

This should be fixed in 0.4.1

borislit commented 9 years ago

Thanks. Ill check it out