Skip to content

Set standalone: true globally #49667

@spock123

Description

@spock123

Which @angular/* package(s) are relevant/related to the feature request?

No response

Description

When creating an application entirely without modules, we have to specify standalone: true in every single component.
This creates more boilerplate and makes the code less readable.

Proposed solution

Would it be possible to create a flag (for example standalone: true) that is set during application bootstrap? This would make it possible to set this standalone globally and thereby avoiding adding the dreaded value to every component in the application.

Or even better, make it possible to set a default standalone value globally, and then let those components who wish to diverge from that, use their local standalone prop to override the global default.

This way we can write entire applications without ever using the standalone prop in components. And we can mix and match if needed, using the local component to override the global default.

Alternatives considered

Writing standalone:true in every component

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: coreIssues related to the framework runtimecross-cutting: standaloneIssues related to the NgModule-less world

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions