Skip to content

Instantly share code, notes, and snippets.

@alxhub
Created March 26, 2018 17:26
Show Gist options
  • Save alxhub/29aee4dd6a761f89f949eed61516c43d to your computer and use it in GitHub Desktop.
Save alxhub/29aee4dd6a761f89f949eed61516c43d to your computer and use it in GitHub Desktop.
import {LibModule} from 'lib';
@Component({
template: '<component-from-sublib></component-from-sublib>',
})
export class AppComponent {
// Ivy generated:
static ngComponentDef = defineComponent({
components: [
// To know the set of dependencies to list here, we need to
// know the AppModule selector map. To gather that selector
// map, we need information from both lib.d.ts and sublib.d.ts,
// even though sublib.ts is not a direct dependency of app.ts
],
template: function AppComponent_Template(cm) { ... }
});
}
@NgModule({
imports: [LibModule]
})
export class AppModule {}
import {SublibModule} from './sublib';
export declare class LibModule {
static ngSelectorMap: SelectorMap<{
exports: [SublibModule]
}>;
}
import {SublibModule} from 'sublib';
@NgModule({
exports: [SublibModule]
})
export class LibModule {}
export declare class SublibComponent {
// component metadata here
}
export declare class SublibModule {
static ngSelectorMap: SelectorMap<{
selectors: [Selector<"component-from-sublib", SublibComponent>]
}>;
}
@Component({
selector: 'component-from-sublib',
template: '...',
})
@NgModule({
declarations: [SublibComponent],
})
export class SublibModule {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment