When using AOT compilation in Angular, an error occurs during build because a private field is being accessed from the HTML in the dropdown trigger, which AOT compilation blocks.
ERROR in [file path here]: : Directive ClrDropdownTrigger, Property 'ifO
penService' is private and only accessible within class 'ClrDropdownTrigger'.
Reference: https://angular.io/guide/aot-compiler#phase-2-code-generation
This issue cannot be reproduced on Stackblitz because it is a build issue.
Steps to reproduce the behavior:
--aot flag. I.E. ng build --aotThe Angular build process with AOT compilation enabled should complete successfully.
App
Device:
This issue did not occur in Clarity versions 1.1.3 and earlier. The error only appears after upgrading to Clarity 2.0.0.
The problem appears to be caused by the usage of ifOpenService.open in the directive host attribute configuration. (https://github.com/vmware/clarity/blob/master/src/clr-angular/popover/dropdown/dropdown-trigger.ts). I have been able to fix the issue by updating the ifOpenService.open to use the active getter similar to the [class.active] attribute.
I'm experiencing similar issues using Angular CLI.

Hi @coryrylan I hope this doesn't bother you. I'm just wondering if there will be an available patch for this fix anytime soon? The bug actually prevents us from compiling the project but the weird thing is that it doesn't throw errors when using the dropdown in a single angular app project regardless of whether the aot is enabled or not. However, when you reference ClarityModule in an angular library project, that's when errors occur.
Here's what I did to reproduce the errors using Angular CLI:
ng new clarity-demong add @clr/angular<clr-dropdown>
<button
clrDropdownTrigger
clrDropdownToggle
class="btn btn-sm btn-link"
>
<clr-icon shape="sort-by"></clr-icon> Name
</button>
<clr-dropdown-menu *clrIfOpen clrPosition="bottom-right">
<button type="button" clrDropdownItem>Last Name</button>
<button type="button" clrDropdownItem>Birthdate</button>
</clr-dropdown-menu>
</clr-dropdown>
ng build or npm buildng generate library shared-libng build shared-lib.I hope you can release a patch soon. Thanks for your hard-work and for this awesome library!
It is our plan to release the fix for this early next week.
Hi there 馃憢, this is an automated message. To help Clarity keep track of discussions, we automatically lock closed issues after 14 days. Please look for another open issue or open a new issue with updated details and reference this one as necessary.
Most helpful comment
It is our plan to release the fix for this early next week.