Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does UI Bootstrap template-url support common angular expression

I have an accordion with overridden template like that:

<uib-accordion-group template-url="/somefolder/accordion-group.html">

but I really want to use a scope variable for that, e.g. something like this:

<uib-accordion-group template-url="{{::urls.templateUrls.customAccordion}}">

but that does not seem to work.

Is there a way to use angular expression in template-url or it's not supported?

like image 470
Ilya Chernomordik Avatar asked Jan 28 '26 15:01

Ilya Chernomordik


1 Answers

The code to read the template-url attribute is in the templateUrl function of the directive as shown here The template-url attribute is being evaluated before the $compile phase so the interpolation you are trying to use has not occurred yet. While the template-url evaluation could be moved to the linking phase, then the $compile phase would have to be run again against the new template and that wouldn't be a very efficient approach

like image 55
Rob J Avatar answered Jan 30 '26 13:01

Rob J



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!