A Component prototype property decorator.
Catch all URIErrors:
import { Component, Catch } from '@sgrud/shell';
declare global {
interface HTMLElementTagNameMap {
'example-component': ExampleComponent;
}
}
@Component('example-component')
export class ExampleComponent extends HTMLElement implements Component {
@Catch((error) => error instanceof URIError)
public readonly error?: URIError;
public get template(): JSX.Element {
return <span>Error message: {this.error?.message}</span>;
}
}
Generated using TypeDoc
Component prototype property decorator factory. Applying the Catch decorator to a property, while optionally supplying a trap will navigate to the Component containing the decorated property when an error, traped by this Catch decorator, occurs during navigation.