Pls give me a example on Angular 2 latest version 2.0.0. Many thanks
It needs a bit of a rewrite as in latest angular 2 the usage of @Component({ directives: [] }) is not supported anymore.
They say to put SELECT_DIRECTIVES in declarations array in app.module.ts. I tryed but it doesn't work. i have errors in ng2-select errors like:
Unhandled Promise rejection: Template parse errors:
Can't bind to 'offClick' since it isn't a known property of 'div'
or
SelectComponent@4:5
The pipe 'highlight' could not be found ("ent)".
Will you update for Angular 2.0.0?
@florea-g Try to add OffClickDirective and HighlightPipe into declarations and import them via:
import {OffClickDirective} from 'ng2-select/components/select/off-click';
import {HighlightPipe} from 'ng2-select/components/select/select-pipes';
@erik-ropez Yes it works :D. Thank you!
I've tried this and I get a run time error.
Can't bind to 'name' since it isn't a known property of 'ng-select'.
- If 'ng-select' is an Angular component and it has 'name' input, then verify that it is part of this module.
....
I have added these components to declarations: SELECT_DIRECTIVES, OffClickDirective, HighlightPipe.
It will compile. Everything loads - I don't get a run-time errors until I add ng2-select to the template.
If you are writing something like this in your template:
<ng-select [name]="myname" ></ng-select>
NgSelectComponent doesn't have a property name which you can set it if is not that case i am not able to help you.
I just removed the name attribute. Strange. It was working before RC5 and there was not been a new version of this component..
updated to ng2 final
Thanks for your update.
I have upgrade it but i have some errors:
-The SELECT_DIRECTIVES doesn't exist when i try to import
-A readonly property on sect.d.ts i think it throws an error
Starting from rc.5 you need to import modules, not directives
On Thu, Sep 22, 2016, 11:23 FLOREA [email protected] wrote:
I have upgrade it but i have some errors:
-The SELECT_DIRECTIVES doesn't exist when i try to import
-A readonly property on sect.d.ts i think it throws an error—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/valor-software/ng2-select/issues/429#issuecomment-248840774,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABDk4-Jn5JCMMGBdYW0b41pYUg2ZiuNwks5qsjrmgaJpZM4KAXr9
.
can you create a plunker|repo for it?
Than I will be able to help faster
On Thu, Sep 22, 2016 at 11:44 AM, FLOREA [email protected] wrote:
Thanks for your response but when i am importing :
import {SelectModule} from 'ng2-select/ng2-select';
It throw an error which say that ng2-select has no exported member
SelectModule.
When i look to ng2-select.d.ts i have this:export * from './components/select/select';
export { SelectModule } from './components/select.module';I don't know why is not finding it
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/valor-software/ng2-select/issues/429#issuecomment-248844794,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABDk42sra7dvLXVIQJO62nfpLLutjxPvks5qskACgaJpZM4KAXr9
.
@florea-g, if you ensure you are using typescript 2.0 that error on the readonly property should go away. I can get it to load without issues, but the styling doesn't work and i can't seem to select anything. It throws an error when i click, self.parent.context.refreshValue is not a function.
Hopefully these issues get resolved. I also created issue #452 asking for a new demo with documentation to help people like us to figure this out.
is there any update on integrating this utility with latest angular 2 , this will be very helpful .
Agreed, I too am having trouble getting this to work with the latest release of Angular 2 (2.4.0).
Clicking on the multiselect changes to typing mode but the dropdown does not appear and none of the items are loaded. Futhermore, typing gives an error
dropdown not appear when click
Most helpful comment
@florea-g Try to add OffClickDirective and HighlightPipe into declarations and import them via:
import {OffClickDirective} from 'ng2-select/components/select/off-click';
import {HighlightPipe} from 'ng2-select/components/select/select-pipes';