Ng-bootstrap: isNumber does not seem to be available on 3.0.0-beta1

Created on 2 Aug 2018  路  3Comments  路  Source: ng-bootstrap/ng-bootstrap

Bug description: toInteger, isNumber, padNumber not available on @ng-bootstrap/ng-bootstrap/util/util

I do get the error that says the _util_ Module is not found.

Link to minimally-working plunker that reproduces the issue:

Not sure how can I illustrate this as there is no example as such. Just migrate from 2.2.1 to 3.0.0-beta1 and add this to a component:

import { toInteger, isNumber, padNumber } from '@ng-bootstrap/ng-bootstrap/util/util';

Version of Angular, ng-bootstrap, and Bootstrap:

Angular: 6.1.0

ng-bootstrap: 3.0.0-beta1

Bootstrap: 4.0.0

wontfix

Most helpful comment

Sorry, this will be a breaking change in 3.0.0 - we are migrating to Angular package format and as such you will not be able to use "deep" imports.

I know that this is not what you want to hear but we see this as a "good thing" since util is supposed to be our private implementation detail and not meant to be pubic API...

This is a very simple utility so feel free to copy it over to your project if you need it: https://github.com/ng-bootstrap/ng-bootstrap/blob/master/src/util/util.ts

All 3 comments

Sorry, this will be a breaking change in 3.0.0 - we are migrating to Angular package format and as such you will not be able to use "deep" imports.

I know that this is not what you want to hear but we see this as a "good thing" since util is supposed to be our private implementation detail and not meant to be pubic API...

This is a very simple utility so feel free to copy it over to your project if you need it: https://github.com/ng-bootstrap/ng-bootstrap/blob/master/src/util/util.ts

Thanks for the info. Yeah it's OK

@pkozlowski-opensource I see your point but those utils are so so general that would be very handy for many devs. I think that apart from regExpEscape and maybe getValueInRange, which seems indeed too specific, all other functions could be exported to not make us copy and paste them.
@brent-langdon has referenced a clear use case.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

elainebyrne picture elainebyrne  路  3Comments

doxasoft picture doxasoft  路  3Comments

mahmoudajawad picture mahmoudajawad  路  3Comments

Palacios95 picture Palacios95  路  3Comments

bygrace1986 picture bygrace1986  路  3Comments