angular-component / router

Angular Component Router - A declarative router for Angular applications
MIT License
253 stars 16 forks source link

feat: Support default exports #95

Open brandonroberts opened 2 years ago

brandonroberts commented 2 years ago

When lazy loading NgModules and Components, support loading them without the .then and allow them to be exported as default.

import { Component } from '@angular/core';

@Component({
  template: `
    <router>
      <route path="/lazy" [load]="components.lazy"> </route>
    </router>
  `,
})
export class MyComponent {
  components = {
    lazy: () => import('./lazy/lazy.component')
  };
}