Sunday, 15 May 2011

javascript - Directive rendering an HTML output which contains rendered HTML in an attribute value -



javascript - Directive rendering an HTML output which contains rendered HTML in an attribute value -

i'm trying render html follows:

<div class="aclass" ng-controller="acertainctrl"> <span class="asubclass" certain-attribute="<ul class='menu'><li class='selected'><a href='/'>home</a></li><li><a href='/about'>about</a></li></ul>"> </span>

how possible combine 2 directives (from understanding should done using two), 1 element , other compiled 1 time first has been compiled, giving output html markup embedded certain-atribute value?

of course of study aim of achieving allowing render html based on model array, items of menu, templating items on how in terms of html, , embedding ouput certain-attribute value.

i'm kind of newbie in angularjs, still not controlling whole directives process , possibilities.

i know not way go, see how implement such crappy thing in angular :d

thanks in advance.

editing: rewriting bit ones didn't understand issue

my goal have html markup value within inline attribute of element (even though crap , nasty). <span data-some-markup="<p>hello</p>"></span>. i utilize attribute directive this: <div ng-controller="somecontroller"><my-custom-element></my-custom-element></div> <my-custom-element> directive rendition depend on somecontroller $scope.data = [{name: home, path: '/'}, { name: 'about', path: '/about' }]; the desired output like: <div class="aclass" ng-controller="acertainctrl"> <span class="asubclass" certain-attribute="<ul class='menu'><li class='selected'><a href='/'>home</a></li><li><a href='/about'>about</a></li></ul>"> </span> </div>

question is, how can exclusively angularjs?

javascript angularjs angularjs-directive angularjs-scope

No comments:

Post a Comment