Ng2-select: Upgrade project to Angular 2.0.0

Created on 5 Sep 2016  路  9Comments  路  Source: valor-software/ng2-select

Cant upgrade angular and other angular rc6 based modules due to this :-

Peer [email protected] wants @angular/common@^2.0.0-rc.1

would it be possible to upgrade ng2-select too ?

Edit :- Since Angular 2.0.0 is out , and other modules are already being updated.

Most helpful comment

All 9 comments

Thanks ! That would help for time being :+1:

I have used the link to aslubsky and it works. However, I could not get it to work for the angular compiler to bootstrap with ahead-of-time compilation

Is there an example of how to load by NgModule? or just we need to add in NgModule.declarations importing SelectComponent ?

besides SelectComponent there is OffClickDirective and HighlightPipe. However, even adding them to NgModule.declarations there is an error because SelectComponent defines directives which is illegal with NgModule in RC6.

Waiting for RC6 version, hope the forks will be published soon to npm..

@Namek
Changing the directives: ... stuff to the ngModule shouldn't be the problem =)

I'm curious if anyone already have a working version.

I have used the link to aslubsky's fork, and like lacma2011, I found that AoT doesn't work. I also found that if you have multiple ng-selects on a page, when you click on one it opens all of them.

It appears that the AoT issue can be fixed by moving the template in select/select.ts into a HTM file and use templateUrl instead of template for @Component:
@Component({
selector: 'ng-select',
templateUrl: 'select.html'
})

Even the *.metadata.json-files need to be generated for aot-compilation, regarding this issue in ng2-bootstrap https://github.com/valor-software/ng2-bootstrap/issues/933

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Cadenei picture Cadenei  路  4Comments

cherrydev picture cherrydev  路  5Comments

Kiwi15 picture Kiwi15  路  4Comments

rkralston picture rkralston  路  3Comments

sharok picture sharok  路  4Comments