Enhance
Learn how to use Aurelia's enhance feature to add interactivity to existing HTML, integrate with other frameworks, hydrate server-rendered content, and create multiple Aurelia instances in your applic
What is Enhancement?
Understanding What Gets Enhanced
Basic Enhancement Syntax
// Using the convenience method (recommended)
const enhanceRoot = await Aurelia.enhance({
host: document.querySelector('#my-content'),
component: { message: 'Hello World' }
});
// Using instance method
const au = new Aurelia();
const enhanceRoot = await au.enhance({
host: document.querySelector('#my-content'),
component: { message: 'Hello World' }
});Component Types: Classes, Instances, or Objects
Key Enhancement Concepts
Proper Cleanup
Practical Enhancement Examples
Server-Rendered Content Enhancement
Widget Integration Example
Dynamic Content Enhancement
Enhancing Dynamically Loaded Content
Enhancing Modal or Dialog Content
Advanced Enhancement Patterns
Using Custom Containers
Lifecycle Hooks in Enhanced Components
Common Enhancement Patterns
Progressive Enhancement Checklist
Best Practices
When NOT to Use Enhancement
Next steps
Last updated
Was this helpful?