Components Future Notes
Naming & Routing
We are considering the possibility of a dual-routing architecture.
The component class itself might have a component name built into it using a TypeScript decorator, like so
Concept code
function Component(name: string) {
return function (constructor: Function) {
Reflect.defineMetadata('componentName', name, constructor);
}
}@Component('my-component')
class MyComponent {
constructor() {
console.log('MyComponent initialized');
}
}
@Component('another-component')
class AnotherComponent {
constructor() {
console.log('AnotherComponent initialized');
}
}
Last updated