I don't think that's how it works. From your first example you might be led to believe the span is transcluded but it really isn't. It's just the content within the dom element (child nodes) that get transcluded; if you replace the span in the first example with a div you'll see that it's still a span that gets transcluded which, I'm guessing, is the default wrapper for a text node with no wrapping element.
Still, you want semantic markup -- I get that. This is as close as I could get: http://plnkr.co/edit/9nIjKYidINVxgpIvHUPE?p=preview If you just want it on input elements the transclude function isn't necessary, but you could compile the wrapper in a compile function. On Wednesday, February 5, 2014 5:20:04 AM UTC-5, Ward Bell wrote: > > I want to put an attribute directive on an input element and I want that > directive to transclude the input element into the directives template as > in: > > <input ng-model="something" myValidationDecorator /> > > where "myValidationDecorator" is the directive. > > Can't seem to do that. I **can** put the directive on an element that > *contains* the input element. But that is not the natural place for my > directive which concerns validation of the input. > > Here is a super-simple plunker > <http://plnkr.co/edit/ov4lqLo9ZOMeDQNPfhfE?p=preview>that illustrates my > conundrum. > -- 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/groups/opt_out.
