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.

AngularJS 1.2 ng-include scope bug #5067

@bullgare

Description

@bullgare

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

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