0

Migrating to the latest package results in the build error.

ERROR in src/app/global.module.ts:106:13 - error TS2304: Cannot find name 'NG_SELECT_DEFAULT_CONFIG'.

106         provide: NG_SELECT_DEFAULT_CONFIG,
    providers: [
        {
            provide: NG_SELECT_DEFAULT_CONFIG,
            useValue: {
                notFoundText: 'Not found',
                loadingText: 'Processing',
                placeholder: 'Please input'
            }
        }
    ]

Any advice and insight is appreciated.

Kok How Teh
  • 3,298
  • 6
  • 47
  • 85

1 Answers1

0

NG_SELECT_DEFAULT_CONFIG was removed. You can set the config by injection NgSelectConfig.

  constructor(private config: NgSelectConfig) {
    this.config.notFoundText = 'Custom not found';
    this.config.loadingText = 'Custom loadingText';
    this.config.placeholder = 'Custom placeholder';
  }

There's also an example on there github page: https://github.com/ng-select/ng-select