Can't bind to 'settings' since it isn't a known property of 'select2'.
Is this actually working? What I'm doing wrong?
<select2 *ngIf="active" [options]="options" [settings]="{ placeholder: value }" [(ngModel)]="selectedValue" name="selectedValue"></select2>
It seems you need to import the component into your module.
#28
It's already imported. Anything else I could be missing?
May be you can provide a demo code? Or you can checkout the demo on master branch.
Did you get an error like this?
ERROR in ./node_modules/angular-select2-component/index.ts
Module build failed: Error: /home/<user>/<projects-dir>/<project-name>/node_modules/angular-select2-component/index.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
I got that error in my case even if I already include the file in tsconfig.json
Please leave your tsconfig.json here. Thanks.
I have the same issue in Angular 6:
ERROR in ./node_modules/angular-select2-component/index.ts
Module build failed (from ./node_modules/@ngtools/webpack/src/index.js):Error: C:\dev\frontend\node_modules\angular-select2-component\index.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
The missing file seems to be part of a third party library. TS files in
published libraries are often a sign of a badly packaged library. Please open an issue in the library repository to alert its author and ask them to package the library using the Angular Package Format (https://goo.gl/jB3GVv).
at AngularCompilerPlugin.getCompiledFile (C:\dev\frontend\node_modules\@ngtools\webpack\src\angular_compiler_plugin.js:753:23)
at plugin.done.then (C:\dev\frontend\node_modules\@ngtools\webpack\src\loader.js:41:31)
at
at process._tickCallback (internal/process/next_tick.js:188:7)
i 「wdm」: Failed to compile.
This is current tsconfi.json:
{
"compileOnSave": false,
"compilerOptions": {
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es5",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2017",
"dom"
]
}
}
After I included the file:
...
"lib": [
"es2017",
"dom"
]
"include": [
"node_modules/angular-select2-component/index.ts"
]
I get following error:
ERROR in No NgModule metadata found for 'AppModule'.
So i included the files as:
"include": [
"node_modules/angular-select2-component"
],
"files": [
"src/app/app.module.ts"
]
But ran into this:
ERROR in Could not resolve module @angular/core i 「wdm」: Failed to compile.