build-your-own-angularjs
build-your-own-angularjs copied to clipboard
Add support for missing nested transclusion case
The following test fails, because the parent transclusion function is not passed into a nested transclusion as "parentTranscludeFn":
it('works with nested transcludes', function() {
var injector = makeInjectorWithDirectives({
inner: function() {
return {
transclude: true,
template: '<u ng-transclude></u>'
};
},
workaround: function() {
return {
transclude: true,
template: '<a href="#"><inner><foo ng-transclude></foo></inner></a>'
};
}
});
injector.invoke(function($compile, $rootScope) {
var el = $('<workaround>y</workaround>');
$compile(el)($rootScope);
expect(el.html()).toEqual('<a href="#"><inner><u ng-transclude=""><foo ng-transclude="">y</foo></u></inner></a>');
});
});