Here is some HTML code with a directive:
<foo>
<span>Bar</span>
</foo>
myapp.directive('foo', function () {
return {
restrict: 'E',
replace: true,
transclude: true,
template: '<div><p>{{usedToBeInSpan}}</p></div>'
}
});
Is there a way to retrieve the content of the nested span
element and assign it to the directives scope as usedToBeInSpan
?
Please note that this is just a simplified example and not intended for actual use in replacing a nested tag.