godbasin / angular-select2

select2 in angular(>=2.0-release).
MIT License
15 stars 11 forks source link

Can't bind to 'options' since it isn't a known property of 'select2' #28

Closed nobady90 closed 6 years ago

nobady90 commented 6 years ago

hi Godbasin, I have an error of not recognizing the tag [option] and [settings]:

Can not bind to 'options' since it is not a known property of 'select2'.
[...]
Can not bind to 'settings' since it is not a known property of 'select2'.

I searched a bit on the net, and I already added the modules 'FormsModule', 'ReactiveFormsModule' and 'SharedModule' in my app.module.ts

what else should I include? thanks a lot

nobady90 commented 6 years ago

I closed the issue because I solved with the use of the ShareModule since I had more than one module that was to use the component.

godbasin commented 6 years ago

It seems you need to import the component into your module,

// import NgModule
import {NgModule} from '@angular/core';
// import Select2Component
import {Select2Component} from 'angular-select2-component';

@NgModule({
  // ...
  // declare components
  declarations: [Select2Component]
})
export class YourModule {
}