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

fix($compile): set $isolateScope correctly for sync template directives #6942

Closed
wants to merge 1 commit into from
Closed

fix($compile): set $isolateScope correctly for sync template directives #6942

wants to merge 1 commit into from

Conversation

shahata
Copy link
Contributor

@shahata shahata commented Apr 1, 2014

Request Type: bug

How to reproduce: http://plnkr.co/edit/nxtZGWarSPKHbtuBSiST?p=preview

The directive with 'templateUrl' is marked correctly as $isolateScope, while the directive with 'template' is marked as $isolateScopeNoTemplate and causes jqLite#scope() to return the incorrect scope for children elements

Component(s): $compile

Impact: small

Complexity: small

This issue is related to:

Detailed Description:

all isolated scope directives that do not have 'templateUrl' where marked as $isolateScopeNoTemplate even if they did have a 'template' attribute. this caused jqLite#scope() to return a different value for child elements in the directive template just because the template loaded synchronously via 'template' and not 'templateUrl'.

Other Comments:

@mary-poppins
Copy link

Thanks for the PR! Please check the items below to help us merge this faster. See the contributing docs for more information.

  • Uses the issue template (#6942)

If you need to make changes to your pull request, you can update the commit with git commit --amend.
Then, update the pull request with git push -f.

Thanks again for your help!

@shahata
Copy link
Contributor Author

shahata commented Apr 17, 2014

bump... this is a really small fix for something that really annoys me :)
can someone please take a look?

@IgorMinar
Copy link
Contributor

lgtm

all isolated scope directives that do not have 'templateUrl' where marked as $isolateScopeNoTemplate even if they did have a 'template' attribute. this caused jqLite#scope() to return a different value for child elements in the directive template just because the template loaded synchronously via 'template' and not 'templateUrl'.
petebacondarwin pushed a commit that referenced this pull request May 9, 2014
All isolated scope directives that do not have `templateUrl` were marked
as `$isolateScopeNoTemplate` even if they did have a `template` attribute.

This caused `jqLite#scope()` to return the wrong value for child elements
within the directive's template.

Closes #6942
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants