Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit 6021f94

Browse files
author
Robert Messerle
committed
sets the initial value manually for boolean attributes
1 parent 70175fd commit 6021f94

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/components/tabs/js/tabsController.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,11 @@ function MdTabsController ($scope, $element, $window, $mdConstant, $mdTabInkRipp
130130
function defineBooleanAttribute (key, handler) {
131131
var attr = $attrs.$normalize('md-' + key);
132132
if (handler) defineProperty(key, handler);
133-
$attrs.$observe(attr, function (newValue) { ctrl[ key ] = newValue !== 'false'; });
133+
if ($attrs.hasOwnProperty(attr)) updateValue($attrs[attr]);
134+
$attrs.$observe(attr, updateValue);
135+
function updateValue (newValue) {
136+
ctrl[ key ] = newValue !== 'false';
137+
}
134138
}
135139

136140
/**

0 commit comments

Comments
 (0)