Skip to content

$any() type cast function #48781

@filipvh

Description

@filipvh

Describe the problem that you experienced

Normally you try to avoid function/method calls when inside the template (with exception being in the action expression) because angular cannot know for sure the function/method is pure. For that reason it is preferred to use a pipe where one needs to keep it pure or define it is not.

In this documentation the $any() function is called. It is not indicated if this will have any effect on performance, as it seems to have the issue I talk about in the paragraph above. OR is this a "special method" where angular knows it pure and thus has no impact on performance.

Enter the URL of the topic with the problem

https://angular.io/guide/template-expression-operators#any-type-cast-function

Describe what you were looking for in the documentation

An indication if (or not) using this method has impact on performance due to it being a method vs. a pipe.

Describe the actions that led you to experience the problem

No response

Describe what you want to experience that would fix the problem

No response

Add a screenshot if that helps illustrate the problem

No response

If this problem caused an exception or error, please paste it here

No response

If the problem is browser-specific, please specify the device, OS, browser, and version

No response

Provide any additional information here in as much as detail as you can

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions