Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Problem replacing the content of a directive with a template that has 2 tags that are not nested #860

@carpasse

Description

@carpasse

You can see an exaple of the bug in http://jsfiddle.net/carpasse/q3sRH/2/

The main difference between the two directives are their templates.

The first directive 'accordionTab' has this template:

       template:'<div>'+
                       <h3 class="accordionTitle"><a href="#">{{title}}</a></h3>' +
                 '<div ng-transclude></div></div>' 

and the second directive has this template:
template:'

{{title}}

' +
'
'

and if I use the second directive the code doesn´t get injected inside the

The issue is that when you do replace, you have to make sure that you replace with the same number of elements.
The ng-transclude happens to be on the second element, which does not get compiled.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions