-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove deprecated .forRoot()
from the code
#3015
Comments
I am not really sure we should do it. When animations will land #2817 we will have to introduce an API to globally configure ng-bootstrap. A natural solution (at least to me) would be to use @NgModule({
imports: [
NgbModule.forRoot({ enableAnimations: true })
]
})
export class AppModule {} This solution is somehow used in plenty of other libraries:
Also, knowing we deliver per-widget modules, we should also keep the same mechanism to allow people using only one or two widgets modules to also configure them. @NgModule({
imports: [
NgbTypeaheadModule.forRoot({ enableAnimations: true }),
NgbModalModule.forRoot({ enableAnimations: true })
]
})
export class AppModule {} @maxokorokov @pkozlowski-opensource WDYT ? Maybe I am completely off topic here, and using raw DI would be enough... I don't know. By raw DI I mean something like that @NgModule({
imports: [
NgbTypeaheadModule,
NgbModalModule
],
providers: [
/* Using a Token ? */
{ provide: NGB_CONFIG, useValue: { enableAnimations: true } },
/* Using a Config Class ? */
{ provide: NgbConfig , useFactory: myNgbConfigFactory },
]
})
export class AppModule {} Myself I prefer the |
Closes #3015 BREAKING CHANGE: Importing any ng-bootstrap module via `.forRoot()` has now been completely removed. The only supported way is the one documented in the [getting started](https://ng-bootstrap.github.io/#/getting-started#installation) page. ```typescript import {NgbModule} from '@ng-bootstrap/ng-bootstrap'; @NgModule({ ... imports: [NgbModule, ...], ... }) export class YourAppModule { } ```
Closes ng-bootstrap#3015 BREAKING CHANGE: Importing any ng-bootstrap module via `.forRoot()` has now been completely removed. The only supported way is the one documented in the [getting started](https://ng-bootstrap.github.io/#/getting-started#installation) page. ```typescript import {NgbModule} from '@ng-bootstrap/ng-bootstrap'; @NgModule({ ... imports: [NgbModule, ...], ... }) export class YourAppModule { } ```
@benouat Did you guys come up with a planned approach for how to take configuration values when registering the module, per your concerns written above? |
@zamzowd nope 😞 not yet |
Should have been removed in
4.0.0
, but was forgotten.Marked as deprecated since
3.0.0
.The text was updated successfully, but these errors were encountered: