Skip to content

Commit

Permalink
fix(angular): create shared module to have access to the value accessors
Browse files Browse the repository at this point in the history
  • Loading branch information
hirsch88 committed Mar 7, 2022
1 parent 76d0615 commit 4c37480
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 21 deletions.
Binary file added packages/components-angular.zip
Binary file not shown.
1 change: 1 addition & 0 deletions packages/components-angular/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export { AngularDelegate } from './overlays/angular-delegate'

// PACKAGE MODULE
export { BalCoreModule } from './module'
export { BalSharedModule } from './shared'

// HELPERS
export { element, parseCustomEvent } from './helpers'
23 changes: 2 additions & 21 deletions packages/components-angular/src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,13 @@ import { CommonModule, DOCUMENT } from '@angular/common'
import { FormsModule } from '@angular/forms'

import { appInitialize, BaloiseDesignSystemAngularConfig } from './app-initialize'
import { BooleanValueAccessor } from './directives/boolean-value-accessor'
import { TextValueAccessor } from './directives/text-value-accessor'
import { SelectValueAccessor } from './directives/select-value-accessor'
import { CheckboxValueAccessor } from './directives/checkbox-accessor'
import { NumericValueAccessor } from './directives/number-value-accessor'

import { AutoFocus } from './focus.directive'
import { AngularDelegate, BalAppModule, BalNoticesModule } from '.'

const DECLARATIONS = [
// directives
AutoFocus,

// ngModel accessors
CheckboxValueAccessor,
BooleanValueAccessor,
TextValueAccessor,
SelectValueAccessor,
NumericValueAccessor,
]

const MODULES = [BalAppModule, BalNoticesModule]

@NgModule({
declarations: [DECLARATIONS],
exports: [DECLARATIONS, MODULES],
declarations: [],
exports: [MODULES],
imports: [CommonModule, FormsModule, MODULES],
providers: [AngularDelegate],
})
Expand Down
30 changes: 30 additions & 0 deletions packages/components-angular/src/shared.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { NgModule } from '@angular/core'
import { CommonModule } from '@angular/common'
import { FormsModule } from '@angular/forms'

import { BooleanValueAccessor } from './directives/boolean-value-accessor'
import { TextValueAccessor } from './directives/text-value-accessor'
import { SelectValueAccessor } from './directives/select-value-accessor'
import { CheckboxValueAccessor } from './directives/checkbox-accessor'
import { NumericValueAccessor } from './directives/number-value-accessor'

import { AutoFocus } from './focus.directive'

const DECLARATIONS = [
// directives
AutoFocus,

// ngModel accessors
CheckboxValueAccessor,
BooleanValueAccessor,
TextValueAccessor,
SelectValueAccessor,
NumericValueAccessor,
]

@NgModule({
declarations: [DECLARATIONS],
exports: [DECLARATIONS],
imports: [CommonModule, FormsModule],
})
export class BalSharedModule {}

0 comments on commit 4c37480

Please sign in to comment.