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.

Angular 1.5.0's transclude lazy compilation is a breaking change #14343

Open
@moneytree-doug

Description

@moneytree-doug

Do you want to request a feature or report a bug?
Bug.

Correct me if I am wrong, but I think this is related to the "Performance Improvements" from the CHANGELOG for 1.5.0-beta.1 dense-dispersion (2015-09-29)

Performance Improvements

$compile: Lazily compile the transclude function 

What is the current behavior?
Angular 1.4.7: http://plnkr.co/edit/7ZPBgqpPnbXF57rvezPf?p=preview

In Angular 1.4.7, you'll see that a service is available because the transcluded element is compiled first therefore it is available later. Please refer to the console.log.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://plnkr.co or similar (template: http://plnkr.co/edit/tpl:yBpEi4).

Angular 1.5.0: http://plnkr.co/edit/5Nh7EHLINDjMlaQ8dZbl?p=preview

In Angular 1.5.0, you'll see that a service is NOT available because the transcluded directive is lazily compiled. Please refer to the console.log.

What is the expected behavior?
The behaviour in Angular 1.4.7.

What is the motivation / use case for changing the behavior?
I want the child directive with transclude to populate a service with data for a parent directive to access in the link function.

Which versions of Angular, and which browser / OS are affected by this issue? Did this work in previous versions of Angular? Please also test with the latest stable and snapshot (https://code.angularjs.org/snapshot/) versions.
It stopped working in the Angular 1.5.X series, but it previously worked in the 1.4.X series.

Other information (e.g. stacktraces, related issues, suggestions how to fix)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions