0

I build an app based on angular + ng-ui-bootstrap + ng-googleCharts

I want display google charts data table containing a ui.bootstrap popover in certain cell. I populate rows of table with data from database.

I fetch data with angular $resource service and then parse data with function, which also create html markup for ui.bootstrap popover with popover angular directive. But this popover don't work.

I suggest, that this is because data inserted to table needs to be recompiled by Angular. I searched web and found solutions to this with angular $compile service.

I found custom directive, called angular-html-bind, that recompile content of that directive element after each change of binded model, so one can dynamically bind other angular directive to view, but I don't know, how to use modus operandi from angular-html-bind in my data table.

I created plunker that describes my effort. Sadly, the angular-html-bind directive does not work in that plunker and I don't know why, but that Plunker contains all necessary modules.

Plunker HERE

Can YOU see any way to my desired goal (that is insert tooltip/popover inside data table cell).

2 Answers 2

0

Your dynamic popover is not working because the directive google-chart has isolated scope, so I don't think this line is being correctly evaluated.

{v: $sce.trustAsHtml($scope.popover)}
Sign up to request clarification or add additional context in comments.

1 Comment

I'm not quite sure, that $sce.trustAsHtml has anything to do with that problem. I tried use $sce service as solution to my problem, but it neither work with it, as without it. AFAIK, $sce only prevent escaping, so if button is rendered as HTML button inside table, that value is not escaped. I need to parse that HTML code with Angular and I'm not sure, that proper $sce implementation will help that.
0

Well, I backed up to obvious solution - don't use Google chart data table, but create classic bootstrap style HTML table and populate it with angular expressions.

I tried experimenting with google-chart, but anyway, it dont followed my mantra: KISS ("Keep It Sweet & Simple" - this time probably in form "Keep It Simple, Stupid!" :)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.