edge-cases !!  yay !!

and I'm using the: item in items almost the same way they do in the 
documentation examples...

I guess trying to do it all on one line is what's hitting the edge ?  If I 
put the {{icon.type}} into an attr w/quotes data-whatever="{{icon.type}}" 
then it works - but then I don't get my directive...  (I can't & don't want 
to use the class option)

I am already doing the string work for now until I had an 
answer: sprintf('<%s data-item-id="%i" 
data-icon="%s"></%s>',eType,attrs.entityId,groups[x],eType)

I do need to do the compilation tho' to get the binding, I can't just add 
the html  -- so I'm interested in comments on my use of $compile 

thanks

al;

 p.s. Sander, why not on the right track?  Things are working and I'm 
trying to publish it as an angular plugin, 
(https://github.com/ajoslin103/angular-action-icons) I sure would like to 
know now what I'm not understanding.  

 p.p.s. I've pushed the code via the desktop GitHub - but it's not showing 
up there yet...

On Saturday, February 14, 2015 at 2:35:13 AM UTC-5, Sander Elias wrote:
>
> Hi Al,
>
> You are hitting a couple of edge-cases off the angular compiler 
> <https://raw.githubusercontent.com/angular/angular.js/master/src/ng/compile.js>,
>  
> just look at the linked source :)
> As Jamie said you can not interpolate attributes this way.
> In conjunction with your other messages I’m not sure you are on the right 
> path.
>
> There is a simple way around to get the result you want, just do some 
> simple string manipulation.
>
> var tmpl='';
> scope.iconList.forEach(function (icon){
>    tmpl+='<span '+icon.type+' data-item-id="' + itemId + '" data-icon="' + 
> icon.name + '" class="ng-scope"></span>'
> })
>
> Just some simple string manipulation, this is also way lighter on the 
> browser.
>
> Does this help you a bit?
> Regards
> Sander
> ​
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to