0

I am using ngx select dropdown in my angular package I have done everything correctly and its working fine but while running build I'm getting an error, for which I'm stuck and can't move forward. pls, help. In dropdown component HTML (change)="selectionChanged($event)" is the only function used and the argument is received in ts file. ! argument passed and used in ts also still error is coming, don't understand what is the root cause of the issue enter image description here HTML

<ngx-select-dropdown *ngIf="dropdownList" (change)="selectionChanged($event)"
            [options]="selectList" [config]="config">
        </ngx-select-dropdown>

TS

import { Component, Output, EventEmitter, Input, OnChanges } from '@angular/core';

@Component({
    selector: 'dropdown-template',
    templateUrl: './dropdown.component.html',
    styleUrls: ['./dropdown.component.scss'],
})
export class DropdownComponent implements OnChanges {
     @Input() selectList;
    
        @Output() dropdownSelected = new EventEmitter<any>();
    
        public config = {};
        public dropdownList: any;
    
        constructor() { }
    
        ngOnChanges() {
            if (this.selectList) {
                this.getValue(this.selectList);
            }
            this.config = {
                displayKey: 'value',
                search: true,
                height: 'auto',
                customComparator: () => { },
                moreText: 'more',
                noResultsFound: 'No results found!',
                searchPlaceholder: 'Search',
                searchOnKey: ''
            };
        }
        // selected change array
        selectionChanged = (e) => {
            if (this.multiSelection) {
                this.dropdownSelected.emit(e);
            } else {
                    this.dropdownSelected.emit(e.value);
            }
        }
}

module.ts

import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { DropdownComponent } from './dropdown.component';
import { HttpClientModule } from '@angular/common/http';
import { CommonModule } from '@angular/common';
import { SelectDropDownModule } from 'ngx-select-dropdown';
import { FormsModule } from '@angular/forms';


@NgModule({
  declarations: [DropdownComponent],
  imports: [
    HttpClientModule,
    CommonModule,
    SelectDropDownModule,
    FormsModule
  ],
  providers: [DropdownComponent],
  exports: [DropdownComponent],
  schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
export class DropdownModule { }
Vishnu Shenoy
  • 862
  • 5
  • 18

1 Answers1

0

downgraded the version of ngx-select-dropdown from 1.4.4 to 1.4.3 solved the issue. Thanks everyone

Vishnu Shenoy
  • 862
  • 5
  • 18