Ngx-bootstrap: Angular 2 RC5

Created on 24 Aug 2016  路  14Comments  路  Source: valor-software/ngx-bootstrap

Is it working with Angular2 RC5?

If the answer is no, I should use the branch feat-rc5?

Thank u.

Most helpful comment

@karser Dropdowns work fine for me in RC5 as long as I don't try and turn my component into a module. I can still import DROPDOWN_DIRECTIVES and BS_VIEW_PROVIDERS into the main app.module, so I can leave "directives" and "providers" empty in my component, I just can't bundle it as an NgModule.

All 14 comments

It doesn't work with RC5 (at least dropdowns). I hope https://github.com/valor-software/ng2-bootstrap/pull/864 will be merged soon

Me too. I'm developing an angular2 application and I want to use this library, but I can't.
Obviously I can't go back to rc4, because rc5 seems to be similar to the final version, as explained here (http://angularjs.blogspot.it/2016/08/angular-2-rc5-ngmodules-lazy-loading.html):

"RC5 represents our expected public API for our 2.0.0 release, including router and forms APIs, and introduces some major improvements in how angular applications are written and compiled. We plan to spend the next few weeks optimizing Angular鈥檚 core for build tooling and tree-shakeablility, providing documentation and guidance on building for production, and tackling any issues that surface with RC5. Stay tuned - we鈥檙e almost there!"

@karser Dropdowns work fine for me in RC5 as long as I don't try and turn my component into a module. I can still import DROPDOWN_DIRECTIVES and BS_VIEW_PROVIDERS into the main app.module, so I can leave "directives" and "providers" empty in my component, I just can't bundle it as an NgModule.

@helzgate Thanks, this trick worked for me

Here is my ng2-bootstrap module which is imported in app module. Maybe it helps.

import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {TAB_DIRECTIVES, ACCORDION_DIRECTIVES, DROPDOWN_DIRECTIVES} from 'ng2-bootstrap/ng2-bootstrap';

@NgModule({
    imports: [CommonModule],
    declarations: [TAB_DIRECTIVES, ACCORDION_DIRECTIVES, DROPDOWN_DIRECTIVES],
    exports: [TAB_DIRECTIVES, ACCORDION_DIRECTIVES, DROPDOWN_DIRECTIVES],
})
export class Ng2BootstrapModule {}

Dropdown, Tab, Accordion might be working with that. But not Datepicker.

@mihaivarga The squirrel guy above, metrophos, I think may have missed my point. Loading the stuff into the main app.module.ts isn't the issue. The issue is bundling your standard components as a module, this is where things get screwed up. Regarding Datepicker, it requires Moment.js so maybe try manually loading it,...just a guess.

I would also like to start using this with Beta5. Everything else in our project has been upgraded. Should I try to reference the code directly instead of installing via npm? Thanks!

@PivotalAnimal You can clone the repo and have a look at the feat-rc5 branch, all the work to support RC5 is done there.

@karser What's the error you get with dropdowns? ng2-bootstrap v1.0.24 works very well with my RC5 app. Just having problems with testing. Dev and Prod work well.

I get this error when using Datepicker:

ORIGINAL EXCEPTION: No value accessor for form control with unspecified name

@valorkin please close :)

Done, BTW rc.5 published as 1.1

@valorkin you deleted feat-RC6 branch therefore you can also delete feat-rc5 branch :) ?

Was this page helpful?
0 / 5 - 0 ratings