Closed mtkopone closed 11 years ago
Hi,
Maybe I'm not doing it right, but I figured something like this should work:
var thing = { link: { name: 'MyLink', description: 'takes me somewhere' } } var directives = { link: { href: function(params) { return 'http://doesnt-render.com/' } } } $('.container').render(thing, directives)
<div class="container"> <a class="link"><span class="name"/><span class="description"/></a> </div>
So I'm trying to add the href-attribute to the parent element, but it fails with "Directive syntax is directive[element][attribute] = function(params)"
Any help is appreciated.
D'oh, that was a bug. Validation for directives was too strict. The example you provided is completely valid and works now.
Hi,
Maybe I'm not doing it right, but I figured something like this should work:
So I'm trying to add the href-attribute to the parent element, but it fails with "Directive syntax is directive[element][attribute] = function(params)"
Any help is appreciated.