Isomorphic code
Avoid Environment-Specific Globals
import { DOM } from 'aurelia-pal';
export class MyComponent {
activate() {
const div = DOM.createElement('div');
DOM.appendChild(DOM.body, div);
}
}Platform Abstraction Layer (PAL)
Example
export class MyPage {
activate() {
document.body.appendChild(document.createElement('div'));
}
}Best Practices
Last updated
Was this helpful?