Skip to main content

Avoid Deprecated With

The avoidDeprecatedWith configuration option prevents the use of deprecated syntax related to implicit with usage in expressions. When set to true, properties and helpers must be explicitly accessed via this.

Configuration

To enable avoidDeprecatedWith, configure it in the app setup:

DOMY.createApp().configure({ avoidDeprecatedWith: true }).mount();

Behavior

  • When avoidDeprecatedWith is true, variables inside expressions must be prefixed with this, preventing potential ambiguities.
  • When false (default), variables can be accessed directly, but this mode may not be recommended due to future deprecations.

Example

<p d-scope="{ message: 'Hello World!' }">{{ this.message }}</p>
DOMY.createApp().configure({ avoidDeprecatedWith: true }).mount();

Will produce: