Sehr klassische Situation, in der ich versuche, einige Komponenten in einem anderen Modul zu verwenden:angular2 "kein bekanntes Element" Fehler: alles versucht wurde
Foreign Komponente:
import { Component, ViewEncapsulation,
ElementRef, ViewChild, Input, Output,
EventEmitter } from '@angular/core';
declare var __moduleName: string
@Component({
moduleId: __moduleName,
selector: 'bidule',
templateUrl: 'bidule.html',
styleUrls: [],
encapsulation: ViewEncapsulation.None
})
export class BiduleComponent {
@Input() config: { }
constructor(protected elRef: ElementRef) {
}
}
// template : <p>basic text</p>
Außenmodul:
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { BiduleComponent } from './bidule'
@NgModule({
imports: [
],
declarations: [
BiduleComponent
],
exports: [
BiduleComponent
]
})
export class BiduleModule {}
Hauptbestandteil:
...
import { BiduleComponent } from '../../bidule/bidule'
...
// template : <bidule></bidule>
Hauptmodul:
import { BiduleModule } from '../../bidule/module'
// ...
@NgModule({
imports: [
// ...
BiduleModule
]
})
Ich glaube, ich habe alles überprüft:
https://stackoverflow.com/questions/44429996#44430230
Wenn Sie eine Idee haben. Danke im Voraus.
(bidule ist ein Wort Französisch für thingamajig)
Hatte wirklich Zweifel; Ich habe es mit/ohne versucht. – spin
Und das Problem besteht weiter oder Sie lösen es? – macvg
Es bleibt bestehen, sonst hätte ich Ihre Antwort validiert :) – spin