Skip to content

isStandalone still defaulting to false #59397

@twittwer

Description

@twittwer

Which @angular/* package(s) are the source of the bug?

core

Is this a regression?

No

Description

The isStandalone seems to default to false instead of true, like the TODO comment states the fallback should be inverted with the new default behaviour.

/**
* Checks whether a given Component, Directive or Pipe is marked as standalone.
* This will return false if passed anything other than a Component, Directive, or Pipe class
* See [this guide](guide/components/importing) for additional information:
*
* @param type A reference to a Component, Directive or Pipe.
* @publicApi
*/
export function isStandalone(type: Type<unknown>): boolean {
const def = getComponentDef(type) || getDirectiveDef(type) || getPipeDef(type);
// TODO: standalone as default value (invert the condition)
return def !== null ? def.standalone : false;
}

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw


Please provide the environment you discovered this bug in (run ng version)

@angular/core 19.0.5

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: coreIssues related to the framework runtime

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions