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.

$compile: "the root of the template always gets a new scope..." What is it about? #15109

Closed
@thorn0

Description

@thorn0

In the docs for $compile, we can read the following:

The scope property can be true, an object or a falsy value: ...
true: A new child scope that prototypically inherits from its parent will be created for the directive's element. If multiple directives on the same element request a new scope, only one new scope is created. The new scope rule does not apply for the root of the template since the root of the template always gets a new scope.

I can't understand the last sentence. Does it mean that even if you set scope to false in the DDO, your directive will create a new scope if it has a template? Then, it's not true: see this plunk. Does this sentence mean something different?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions