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.

bindToController with object hash allows binding properties with new instead of isolate scope #13658

Closed
@Narretz

Description

@Narretz

In 35498d7, bindToController was changed to allow setting an object hash instead of true.

The object hash works the same as with the scope property, and sets up the bindings to the controller. What it not does is create an isolate scope for the directive. You have to manually set the scope property to {}, but you can also set it to true or if you don't specify it, now scope is created at all. The commit says this is intentional, but I can't see how this is something that should be possible. Using scope with a has always creates an isolate scope, and I can't see why you'd want bindings with a new / no scope. It also defeats the purpose of defining your bindings with bindToController, because you still have to set the scope prop.

The whole behavior is actually undocumented, so it's possible not many people are using it. But imo, we should change it so that bindToController with hash creates an isolate scope in all cases.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions