What is the purpose of any type cast function?

You can disable binding expression type checking using $any() type cast function(by surrounding the expression). In the following example, the error Property contacts does not exist is suppressed by casting user to the any type.

template: '{{ $any(user).contacts.email }}';

The $any() cast function also works with this to allow access to undeclared members of the component.

template: '{{ $any(this).contacts.email }}';

Author of content
Edit this page

Made by Michael Sakhniuk

Twitter