我需要通过ReportComponent
选择器在另一个组件(ContactsComponent
)中使用一个组件(<app-reports>
)。
对于这两个组件,我都在使用模块,因此,当我尝试将ReportModule
导入到ContactsDetailsModule
中时,碰巧ContactDetailsComponent
的内容被{ {1}}内容(即使不使用html选择器)。
这是report.module.ts
ReportComponent
这是contacts-datails.module.ts
import { NgModule } from '@angular/core';
import { CommonModule, DatePipe } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { Routes, RouterModule } from '@angular/router';
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
import { UiSwitchModule } from 'ngx-toggle-switch';
import { ToastrModule, ToastrService } from 'ngx-toastr';
import { QuillModule } from 'ngx-quill';
import { ReportComponent } from './report.component';
import { sanitizeHtmlPipe } from './sanitize-html.pipe';
import { BrowserModule } from '@angular/platform-browser';
const routes: Routes = [
{
path: '',
data: {
title: 'Report',
urls: [
{ title: 'Dashboard', url: '/dashboard' },
{ title: 'Report' }
]
},
component: ReportComponent
}
];
@NgModule({
imports: [FormsModule, CommonModule, RouterModule.forChild(routes), NgbModule.forRoot(), QuillModule, UiSwitchModule, ToastrModule.forRoot()],
declarations: [ReportComponent, sanitizeHtmlPipe],
exports: [ReportComponent, sanitizeHtmlPipe],
providers: [DatePipe, ToastrService]
})
export class ReportModule {}
您能帮助我了解我在做什么吗?