Here's a typical scenario where I attempt to incorporate a component from another module :
External component :
import { Component, ViewEncapsulation,
ElementRef, ViewChild, Input, Output,
EventEmitter } from '@angular/core';
declare var __moduleName: string
@Component({
moduleId: __moduleName,
selector: 'thingamajig',
templateUrl: 'thingamajig.html',
styleUrls: [],
encapsulation: ViewEncapsulation.None
})
export class ThingamajigComponent {
@Input() config: { }
constructor(protected elRef: ElementRef) {
}
}
// template : <p>basic text</p>
External module :
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { ThingamajigComponent } from './thingamajig'
@NgModule({
imports: [
],
declarations: [
ThingamajigComponent
],
exports: [
ThingamajigComponent
]
})
export class ThingamajigModule {}
Main component :
...
import { ThingamajigComponent } from '../../thingamajig/thingamajig'
...
// template : <thingamajig></thingamajig>
Main module :
import { ThingamajigModule } from '../../thingamajig/module'
// ...
@NgModule({
imports: [
// ...
ThingamajigModule
]
})
I believe all the necessary checks have been performed:
If you have any insights or suggestions, they would be greatly appreciated. Thank you!
("thingamajig" is the English equivalent of the French word "bidule")