Document.prototype.conduit >= 1.0.0

Description

When queried through the appropriate method, a document can contain a reference to the conduit instance.

Type

Examples

Ensure a document has a conduit property

If you want a document to have access to the conduit instance, you need to use the getModel instance

// Say we're in a controller action
StaticController.setAction(async function someAction(conduit) {
    
    // Using `this.getModel()` instead of `Model.get()` is important!
    let page_model = this.getModel('Page');
    
    // Get a document
    let page = await page_model.find('first');
    
    // Page will have the same reference to the conduit
    page.conduit === conduit;
    
});