angularjs 如何在Angular中使用NgBootstrap和FormsModule显示模态弹出窗体

xqnpmsa8  于 9个月前  发布在  Angular
关注(0)|答案(1)|浏览(108)

我将感谢任何支持我试图使用NgBootstrap和FormsModule在Angular中显示模态弹出窗体,但模块NgbModule未导入。我有:node 16.15.1 15.1.5 core 15.1.5我转到app.modules.ts并在Imports中添加模块NgbModule,但我得到几个错误
我安装了数据包:
font-awesome --保存
bootstrap --保存
我添加@ng-bootstrap/ng-bootstrap
Angular-material --保存
错误:enter image description here

{"name": "cragcity-website",
  "version": "0.0.1",
  "scripts": {
    "ng": "ng",
    "start": "ng serve --open",
    "build": "ng build",
    "build-prod": "ng build --prod",
    "watch": "ng build --watch --configuration development",
    "test": "ng test"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "15.1.4",
    "@angular/cdk": "15.1.4",
    "@angular/common": "15.1.4",
    "@angular/compiler": "15.1.4",
    "@angular/core": "15.1.4",
    "@angular/flex-layout": "12.0.0-beta.34",
    "@angular/forms": "15.1.4",
    "@angular/material": "15.1.4",
    "@angular/platform-browser": "15.1.4",
    "@angular/platform-browser-dynamic": "15.1.4",
    "@angular/router": "15.1.4",
    "@ckeditor/ckeditor5-angular": "^2.0.2",
    "@ckeditor/ckeditor5-build-classic": "^31.0.0",
    "@ckeditor/ckeditor5-upload": "^31.0.0",
    "angularx-social-login": "3.5.7",
    "bootstrap": "^5.2.3",
    "bootstrap-icons": "^1.10.2",
    "font-awesome": "^4.7.0",
    "jquery": "^3.6.3",
    "ng-recaptcha": "^8.0.1",
    "ngx-toastr": "14.0.0",
    "ngx-treeview": "10.0.2",
    "ngx-ui-loader": "13.0.0",
    "popper.js": "^1.16.1",
    "rxjs": "~6.6.0",
    "tslib": "2.2.0",
    "zone.js": "0.11.4"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "15.1.5",
    "@angular/cli": "15.1.5",
    "@angular/compiler-cli": "15.1.4",
    "@types/jasmine": "3.8.1",
    "@types/node": "12.11.1",
    "jasmine-core": "3.8.0",
    "karma": "^6.4.1",
    "karma-chrome-launcher": "3.1.0",
    "karma-coverage": "2.0.3",
    "karma-jasmine": "4.0.1",
    "karma-jasmine-html-reporter": "1.7.0",
    "typescript": "4.9.5"
  }
}

个字符

slmsl1lt

slmsl1lt1#

无论你在哪里声明(在某个模块.ts中)LandingComponent,在那个模块.ts文件中,你必须在那个模块的导入中导入CragcityFooterComponent,所以假设你在pages.module.ts中声明了LandingComponent,它看起来像这样,

pages.module.ts

import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { LandingComponent } from 'path/to/landing.component';
import { CragcityFooterComponent } from 'path/to/cragcity-footer.component';

@NgModule({
  declarations: [
    LandingComponent
  ],
  imports: [
    CommonModule,
    PagesRoutingModule,
    CragcityFooterComponent
  ]
})
export class PagesModule { }

字符串
查看声明中的LandingComponent和导入中的CragcityFooterComponent

相关问题