allianz / ng-aquila

Angular UI Component library for the Open Insurance Platform
https://allianz.github.io/ng-aquila/
Other
205 stars 32 forks source link

[NxLinkComponent] 'classNames' is defined as an accessor in class 'MappedStyles' #6

Closed BenjaminHofstetter closed 3 years ago

BenjaminHofstetter commented 3 years ago

The compiler is throwing an error.

ERROR in node_modules/@aposin/ng-aquila/link/link.component.d.ts:17:5 - error TS2610: 'classNames' is defined as an accessor in class 'MappedStyles', but is overridden here in 'NxLinkComponent' as an instance property.

    17     classNames: any;
           ~~~~~~~~~~

Expected Behavior๐Ÿ“—

no error. You can remove classNames from NxLinkComponent or work with abstract in the parent class.

Actual Behavior ๐Ÿ“•

When i have a look at link.component.d.ts then i see

export declare class NxLinkComponent extends MappedStyles implements AfterContentInit {
   .....
    /**
     * Sets the style of the link, thereby altering the visual appearance.
     *
     * You can use any combination of 'black', 'icon-right', 'negative' or 'text'
     */
    classNames: any;  // <---- an instance property called classNames

when i have a look at "mapped-styles.d.ts" ... i see that an accessor is defined with the same same.

export declare class MappedStyles {
 ....
    get classNames(): string;                        // <---- an accessor called classNames
    set classNames(value: string);

Minimal Reproduction ๐Ÿ”ฌ

Try to compile something with NxLink.

Environment

Angular CLI: 10.1.4
Node: 12.18.3
OS: darwin x64

Angular: 10.1.4
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Ivy Workspace: Yes

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1001.4
@angular-devkit/build-angular   0.1001.4
@angular-devkit/core            10.1.4
@angular-devkit/schematics      10.1.4
@angular/cdk                    10.2.3
@schematics/angular             10.1.4
@schematics/update              0.1001.4
rxjs                            6.6.3
typescript                      4.0.3

and

"@aposin/ng-aquila": "^10.1.0",

Additional Information ๐Ÿ“–

none

Phil147 commented 3 years ago

Hi @BenjaminHofstetter

thx for the first issue and for the good details ๐ŸŽ‰ ๐Ÿ™‚ We are aware of the issue, that is because of Typescript 4 and this breaking change: https://devblogs.microsoft.com/typescript/announcing-typescript-4-0-beta/#properties-overridding-accessors-and-vice-versa-is-an-error We are not supporting Typescript 4 yet but we will work on it soon. Could you please try and go back to Typescript 3.9.7 if that helps?

Phil147 commented 3 years ago

Hi @BenjaminHofstetter

with version 10.2.0 we introduced typescript 4 support. that should fix your issue. If not please let us know.