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

AngularJS 1.2 ng-include scope bug #5067

Closed
bullgare opened this issue Nov 21, 2013 · 1 comment
Closed

AngularJS 1.2 ng-include scope bug #5067

bullgare opened this issue Nov 21, 2013 · 1 comment

Comments

@bullgare
Copy link
Contributor

Hi.
I've got an issue while moving from 1.0.8 to 1.2.1
The issue is this. Now I can not use controller scope in included template if I use constructs like this:

<div ng-include="'mytemplate'" ng-controller="MyCtrl"></div>

There are to jsbins for testing that:
http://jsbin.com/UBaXumED/2/edit?html,js,output is using AngularJS 1.0.8
and
http://jsbin.com/AMaqUMuz/2/edit?html,js,output is using AngularJS 1.2.1

I expect both templates to output digits '2' then '1'. But the second demo is showing only '2'.
That's because controller's scope is nested in include's one, like on this screenshot:
http://grab.by/sdLc

@btford
Copy link
Contributor

btford commented Nov 21, 2013

This is a duplicate and has already been fixed in master. It will be in 1.2.2.

@btford btford closed this as completed Nov 21, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants