-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(angular): enable standalone first draft (#1170)
* feat(angular): enable standalone first draft * chore: update package.json * feat(angular): add standalone solution * chore: add changeset * chore: adjust bundle * chore: improve package.json to reduce side effects * chore: update package.lock * chore: add missing build for standalone * chore: add missing build for standalone * chore: add bal-doc-app to e2e tests
- Loading branch information
Showing
61 changed files
with
16,782 additions
and
1,039 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
--- | ||
'@baloise/design-system-components-angular': minor | ||
--- | ||
|
||
All components are now available as standalone elements for Angular v17. | ||
|
||
Use the `provideBaloiseDesignSystem` provider within the app.config.ts file, where Angular providers are typically defined. | ||
|
||
**app.config.ts** | ||
|
||
```ts | ||
import { ApplicationConfig, importProvidersFrom } from '@angular/core' | ||
|
||
import { provideBaloiseDesignSystem } from '@baloise/design-system-components-angular/standalone' | ||
|
||
export const appConfig: ApplicationConfig = { | ||
providers: [provideBaloiseDesignSystem()], | ||
} | ||
``` | ||
|
||
In each app component, import the necessary Baloise Design System components or a bundled set. | ||
|
||
**app.component.ts** | ||
|
||
```ts | ||
import { CUSTOM_ELEMENTS_SCHEMA, Component } from '@angular/core' | ||
import { CommonModule } from '@angular/common' | ||
import { BalApp, BalButton } from '@baloise/design-system-components-angular/standalone' | ||
|
||
export interface UpdateControl { | ||
name: string | ||
value: any | ||
} | ||
|
||
@Component({ | ||
selector: 'app-root', | ||
standalone: true, | ||
schemas: [CUSTOM_ELEMENTS_SCHEMA], | ||
imports: [CommonModule, BalApp, BalButton], | ||
template: ` | ||
<bal-app> | ||
<main class="container py-normal"> | ||
<bal-button>My Button</bal-button> | ||
</main> | ||
</bal-app> | ||
`, | ||
}) | ||
export class AppComponent {} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
import { ApplicationConfig, importProvidersFrom } from '@angular/core' | ||
|
||
import { BaloiseDesignSystemModule } from '../design-system' | ||
import type { ApplicationConfig } from '@angular/platform-browser' | ||
import { balProviders } from '../design-system' | ||
|
||
export const appConfig: ApplicationConfig = { | ||
providers: [importProvidersFrom(BaloiseDesignSystemModule.forRoot())], | ||
providers: [...balProviders], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
import { importProvidersFrom } from '@angular/core' | ||
|
||
import { BaloiseDesignSystemModule } from '@baloise/design-system-components-angular' | ||
|
||
export { BaloiseDesignSystemModule, BalModalService } from '@baloise/design-system-components-angular' | ||
|
||
export const balImports = [BaloiseDesignSystemModule] | ||
|
||
export const balProviders = [importProvidersFrom(BaloiseDesignSystemModule.forRoot())] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
import { importProvidersFrom } from '@angular/core' | ||
|
||
import { BaloiseDesignSystemModule } from '@baloise/design-system-components-angular/legacy' | ||
|
||
export { BaloiseDesignSystemModule, BalModalService } from '@baloise/design-system-components-angular/legacy' | ||
|
||
export const balImports = [BaloiseDesignSystemModule] | ||
|
||
export const balProviders = [importProvidersFrom(BaloiseDesignSystemModule.forRoot())] |
Oops, something went wrong.