2

包json

             "dependencies": {
        "@angular/common": "8.0.0",
        "@angular/compiler": "8.0.0",
        "@angular/core": "8.0.0",
        "@angular/forms": "8.0.0",
        "@angular/platform-browser": "8.0.0",
        "@angular/platform-browser-dynamic": "8.0.0",
        "@angular/router": "8.0.0",
        "@types/jquery": "^3.3.x",
        "@types/select2": "^4.0.x",
        "core-js": "2.6.9",
        "jquery": "^3.4.x",
        "ng-select2": "^1.1.2",
        "rxjs": "6.5.2",
        "select2": "^4.0.x",
        "zone.js": "0.9.1"
         }

应用模块.ts

    import { NgModule } from '@angular/core';
    import { BrowserModule } from '@angular/platform-browser';
    import { FormsModule } from '@angular/forms';
    import * as jquery from 'jquery';
    import { AppComponent } from './app.component';
    import { HelloComponent } from './hello.component';

    import { NgSelect2Module } from 'ng-select2';
    @NgModule({
      imports:      [ BrowserModule, FormsModule,NgSelect2Module ],
      declarations: [ AppComponent, HelloComponent ],
      bootstrap:    [ AppComponent ]
    })
    export class AppModule { }

堆栈闪电战

https://stackblitz.com/edit/angular-qsa8le?file=src%2Fapp%2Fapp.module.ts

https://www.npmjs.com/package/ng-select2/v/1.1.2

  • 我已经检查了 Jquery 作为依赖项安装。

  • 任何建议都是最受欢迎的。

4

0 回答 0