如何设置它,以便我可以在角度中为我的自定义组件获得 intenlesense?下面的屏幕截图显示“app-nav-bar”没有智能感知
这是我的结构:
这是我的 admin.module.ts:
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterModule } from '@angular/router';
import { adminRoutes } from './admin.routing';
import { NavBarComponent } from './nav-bar/nav-bar.component';
import { ProductBuilderComponent } from './product-builder/product-builder.component';
@NgModule({
declarations: [NavBarComponent, ProductBuilderComponent],
imports: [CommonModule, RouterModule.forChild(adminRoutes)],
})
export class AdminModule {}
这是我的 app.module.ts:
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { MmApi2Module } from 'mm-api3';
import { ReactiveFormsModule } from '@angular/forms';
import { HttpClientModule } from '@angular/common/http';
import { AdminModule } from './admin/admin.module';
@NgModule({
declarations: [AppComponent],
imports: [
BrowserModule,
ReactiveFormsModule,
AppRoutingModule,
BrowserAnimationsModule,
AdminModule,
],
providers: [],
bootstrap: [AppComponent],
})
export class AppModule {}