taiga-family / taiga-ui

Angular UI Kit and components library for awesome people
https://taiga-ui.dev
Apache License 2.0
3.27k stars 459 forks source link

📚 - Update `Getting Started` page with standalone example #4766

Closed SerjMalko closed 1 year ago

SerjMalko commented 1 year ago

Playground Link

//

Description

Get error in console:

Assertion failed: EventPluginsModule must come after BrowserModule in imports

But, BrowserModule that doesn’t need to be explicitly imported when bootstrapping a Standalone Component.

Angular version

16

Taiga UI version

3.33

Which browsers have you used?

Which operating systems have you used?

waterplea commented 1 year ago

Can you share your app bootstrap configuration?

SerjMalko commented 1 year ago

bootstrapApplication(AppComponent, appConfig).catch((err) => console.error(err) );

export const appConfig: ApplicationConfig = { providers: [provideAnimations(), provideRouter(appRoutes, withEnabledBlockingInitialNavigation()), provideHttpClient()], };

waterplea commented 1 year ago

bootstrapApplication(AppComponent, appConfig).catch((err) => console.error(err) );

export const appConfig: ApplicationConfig = { providers: [provideAnimations(), provideRouter(appRoutes, withEnabledBlockingInitialNavigation()), provideHttpClient()], };

What about tui-root, do you have imports: [TuiRootModule] inside your app component? It looks like it should be imports: [TuiRootComponent] there and add importProvidersFrom(TuiRootModule) to your bootstrap providers. Could you please try it? I guess it's a documentation issue rather than a bug and we should add standalone bootstrap config to the getting started. I believe ng add taiga-ui already does it properly.