@@ -15,6 +15,9 @@ function MdTabsController ($scope, $element, $window, $timeout, $mdConstant, $md
15
15
destroyed = false ,
16
16
loaded = false ;
17
17
18
+ //-- define one-way bindings
19
+ defineOneWayBinding ( 'stretchTabs' ) ;
20
+
18
21
//-- define public properties with change handlers
19
22
defineProperty ( 'focusIndex' , handleFocusIndexChange , ctrl . selectedIndex || 0 ) ;
20
23
defineProperty ( 'offsetLeft' , handleOffsetChange , 0 ) ;
@@ -24,7 +27,6 @@ function MdTabsController ($scope, $element, $window, $timeout, $mdConstant, $md
24
27
defineBooleanAttribute ( 'noInkBar' ) ;
25
28
defineBooleanAttribute ( 'dynamicHeight' , handleDynamicHeight ) ;
26
29
defineBooleanAttribute ( 'noPagination' ) ;
27
- defineBooleanAttribute ( 'stretchTabs' ) ;
28
30
defineBooleanAttribute ( 'swipeContent' ) ;
29
31
defineBooleanAttribute ( 'noDisconnect' ) ;
30
32
defineBooleanAttribute ( 'autoselect' ) ;
@@ -104,6 +106,11 @@ function MdTabsController ($scope, $element, $window, $timeout, $mdConstant, $md
104
106
$scope . $watch ( '$mdTabsCtrl.selectedIndex' , handleSelectedIndexChange ) ;
105
107
}
106
108
109
+ function defineOneWayBinding ( key ) {
110
+ var attr = $attrs . $normalize ( 'md-' + key ) ;
111
+ $attrs . $observe ( attr , function ( newValue ) { ctrl [ key ] = newValue ; } ) ;
112
+ }
113
+
107
114
/**
108
115
* Defines boolean attributes with default value set to true. (ie. md-stretch-tabs with no value
109
116
* will be treated as being truthy)
0 commit comments