Looking for help with a form of dynamic template, alas this one needed for 
attribute values, rather than DOM element contents...

starting with twitter bootstrap's popover:

*<button type="button" class="btn btn-default" data-toggle="popover" 
data-content="Howdee!">*

*  Click me*

*</button>*


Because the popup markup is huge and repeated, I'd like instead to use a 
template for the popover content instead:

*<button type="button" class="btn btn-default" data-toggle="popover" 
data-template="my-template">*
* Click me*
*</button>*


Luckily bootstrap's popover takes a function for the content option so I've 
tried something like this in my directive which is a thin wrapper around 
popover (coffeescript, apologies):

      options.content = =>
          template = $templateCache.get(templateId)
          compiled = $compile(template)(scope)
          compiled.html()
      ...
      elem.popover(options)


But what I get back for the content has no evaluation of expressions, 
repeaters, etc. - seemingly "uncompiled".

I'm sure this is a gross misunderstanding on my part about $compile and how 
to turn templates into (fully) compiled/evaluated strings.  I'd sure love 
to understand what I'm doing so obviously wrong.... thx.

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to