パッケージ 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が依存関係としてインストールされていることを確認しました。
どんな提案でも大歓迎です。