Skip to content

bug: Angular Value Accessor is created without selector specified for older versions #174

Open
@A143447

Description

@A143447

Versions:

  • @stencil/core 2.6.0
  • @stencil/angular-output-target 0.0.7
  • tslib 2.0.0
  • typescript 4.3.5

In the stencil.config.ts I specify the following for the valueAccessorConfigs:

const angularValueAccessorBindings: ValueAccessorConfig[] = [
  {
    elementSelectors: ['dls-radio-button-group'],
    event: 'selectedValueChanged',
    targetAttr: 'selectedValue',
    type: 'radio'
  },
  {
    elementSelectors: ['dls-text-input'],
    event: 'valueChange',
    targetAttr: 'value',
    type: 'text'
  }
];

When I execute the build process the generated value-accessor.ts file has the following as the first 9 lines:

import { Directive, ElementRef, HostListener } from '@angular/core';
import { ControlValueAccessor } from '@angular/forms';

@Directive({ selector: 'dls-value-accessor' })
export class ValueAccessor implements ControlValueAccessor {
  private onChange: (value: any) => void = () => {
    /**/
  };
  private onTouched: () => void = () => {

I need to manually enter the Directive line to be
@Directive({ selector: 'dls-value-accessor' })
for Angular to be able to consume the web components.

Metadata

Metadata

Assignees

No one assigned

    Labels

    package: angular@stencil/angular-output-target packagetype: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions