Trying out templating with directive, I used a directive inside a template and set its value dynamically:
.directive('dyn', function(){
return{
template:'<div content="{{param}}"></div>{{param}}',
restrict:'E',
scope:{param:'attribute'}
};
.directive('content',function(){
return function(scope,element,attrs){
element.text('content: '+attrs.content);
};
})
inside 'content' attrs.content is undefined. I expected it to be the value of 'param'
see http://jsfiddle.net/CkWWm/1/
Is this not supposed to work or did I do something wrong?
thanks a lot
nidi
nidi
--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To post to this group, send email to ang...@googlegroups.com.
To unsubscribe from this group, send email to angular+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/angular?hl=en.
Hi Pete
Thanks for the solution. This works perfectly for me.