Answer the question
In order to leave comments, you need to log in
How to selectively pass a parameter to a directive in UI-bootstrap Angular?
In the UI-bootstrap
library, the
Popover directive popover-placement takes one of two parameters top or bottom.
I need either top or bottom depending on the height of the element on the page, how can I do this?
Answer the question
In order to leave comments, you need to log in
well, this parameter takes a string
// Любым удобным способом измеряйте высоту и передавайте её в дерективу подобным образом.
$scope.position = 'top';
<button popover-placement="{{ position }}" popover="On the Top!" class="btn btn-default">Top</button>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question