ng-bootstrap / ng-bootstrap

Angular powered Bootstrap
https://ng-bootstrap.github.io
MIT License
8.22k stars 1.55k forks source link

Missing export of NgbTime #2831

Open dominikhb opened 6 years ago

dominikhb commented 6 years ago

Bug description:

In version 2.2.2 I could import NgbTime like this: import { NgbTime } from '@ng-bootstrap/ng-bootstrap/timepicker/ngb-time';

Now I tried to upgrade and could not import the Class anymore. Because following is missing in the current version of ng-bootstrap:

src/timepicker/timepicker.module.ts export {NgbTime} from './ngb-time';

src/index.ts export { NgbTimepickerModule, NgbTimepickerConfig, NgbTimeStruct, NgbTimepicker, NgbTimeAdapter, NgbTime } from './timepicker/timepicker.module';

Is there a reason why NgbTime is not exported anymore. Can you export it?

Versions of Angular, ng-bootstrap and Bootstrap:

Angular: 7 ng-bootstrap: 4 Bootstrap: 4.1.3

pkozlowski-opensource commented 6 years ago

Is there a reason why NgbTime is not exported anymore. Can you export it?

With ng-bootstrap 3.0.0 we've migrated to Angular CLI and it changed the package format. With this change all the symbols now should be imported from the top-level namespace (@ng-bootstrap/ng-bootstrap). As such ``

Regarding NgbTime - so far it wasn't meant to be a public APIm, hence it is not exported from @ng-bootstrap/ng-bootstrap. We consider NgbTimeStruct as the public API.

We could mark this as a feature request if you see NgbTime as an useful addition and can elaborate on use-case(s).

dominikhb commented 6 years ago

Yes, as feature request it would be nice. We built a component that depends on NgbTime and now we struggle with the update to Angular 7 and latest ng-bootstrap.

pkozlowski-opensource commented 6 years ago

Right. We might open it as public but till then your best approach is to copy it over to your project - it is not a huge class: https://github.com/ng-bootstrap/ng-bootstrap/blob/master/src/timepicker/ngb-time.ts