This repository was archived by the owner on Sep 5, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
src/components/datepicker Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change 135
135
/** @final {!angular.JQLite} */
136
136
this . $element = $element ;
137
137
138
+ /** @final {!angular.Attributes} */
139
+ this . $attrs = $attrs ;
140
+
138
141
/** @final {!angular.Scope} */
139
142
this . $scope = $scope ;
140
143
243
246
DatePickerCtrl . prototype . installPropertyInterceptors = function ( ) {
244
247
var self = this ;
245
248
246
- // Intercept disabled on the date-picker element to disable the internal input.
247
- // This avoids two bindings (outer scope to ctrl, ctrl to input).
248
- Object . defineProperty ( this . $element [ 0 ] , 'disabled' , {
249
- get : function ( ) { return self . isDisabled ; } ,
250
- set : angular . bind ( self , self . setDisabled )
251
- } ) ;
249
+ if ( this . $attrs [ 'ngDisabled' ] ) {
250
+ // The expression is to be evaluated against the directive element's scope and not
251
+ // the directive's isolate scope.
252
+ this . $element . scope ( ) . $watch ( this . $attrs [ 'ngDisabled' ] , function ( isDisabled ) {
253
+ self . setDisabled ( isDisabled ) ;
254
+ } ) ;
255
+ }
252
256
253
257
Object . defineProperty ( this , 'placeholder' , {
254
258
get : function ( ) { return self . inputElement . placeholder ; } ,
You can’t perform that action at this time.
0 commit comments