0

I am trying to build a set of dynamic tabsets with dynamic content,

http://plnkr.co/edit/bhtMin1B1dwwqYvyrpVl?p=preview

1) Clicking on Dashboard opens a new tab with directive

  • When I provide the content of a as the directive, this gets rendered as a string.
  • I've tried to use the html bind unsafe and $compile functions to make this run as an Angular component - but haven't be able to

2) Click on menu [Project Management-> Project] shows a list of Sites, on clicking of which I need to open another tab passing a parameter (Proj-ID or Site-Id)

  • The idea is to call a function on click of the Site Name, I'll open a new tab with content as a directive
  • But since I am stuck with the previous problem, I am not able to do this
  • Is this the right way of passing params to the directive.

Right now, the plunkr tries to o/p the tab content as a file, a string and compile - with no success

[I've revised this question with relevant details from a prev question]

SOLUTION FOUND FOR #1:

For some reason ng-bind-html-unsafe doesn't work with Angular Elements. I had to do create a compile directive http://docs.angularjs.org/api/ng.$compile, based on info I found here on STO

Jaya
  • 26
  • 4

1 Answers1

0

In tabs-directive.html, you can definitely use ngBindHtmlUnsafe. Make sure don't put {{}} around the variable.

String:  <div ng-bind-html-unsafe="tab.content"></div>
zs2020
  • 53,766
  • 29
  • 154
  • 219
  • Thanks @sza .. for some reason that didn't work I think ng-bind-html-unsafe is good for non-Angular elements, and Angular Elements need to be "compiled"
    I found a solution here.. http://stackoverflow.com/questions/17417607/angular-ng-bind-html-unsafe-and-directive-within-it
    – Jaya Aug 17 '13 at 00:26