build-your-own-angularjs icon indicating copy to clipboard operation
build-your-own-angularjs copied to clipboard

Add support for missing nested transclusion case

Open teropa opened this issue 9 years ago • 0 comments

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>');
      });
    });

teropa avatar Jun 12 '15 11:06 teropa