S
S
Sergey Nikolaev2015-06-23 20:13:49
JavaScript
Sergey Nikolaev, 2015-06-23 20:13:49

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

1 answer(s)
A
Alexander Tartmin, 2015-06-23
@baskerville42

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 question

Ask a Question

731 491 924 answers to any question