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.

Make include works better with primitive $scope values #943

@cburgdorf

Description

@cburgdorf

Here is the problem:

When you use ng-include people are assuming that the view that is included has full access to everything the parent view has. In fact it has! However, ng-include creates a new scope and therefore all the primitive values on the parent scope become readonly values for the included view.

The problem is illustrated here: http://jsfiddle.net/cburgdorf/PMc69/1/
The textbox should update the div but it isn't.

It's fixable by wrapping your primitive with an object like so:
http://jsfiddle.net/cburgdorf/RwWs3/2/

However, that's cumbersome and counterintuitive. Can we fix that?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions