#spartan ng and analogjs error

3 messages · Page 1 of 1 (latest)

wraith plaza
#

has anybody encountered this error with BrnMenuTriggerDirective? i have everything configured with angular cdk and the vite ssrExternals

ssr: {
noExternal: [
'@spartan-ng/',
'@angular/cdk/
',
'@ng-icons/',
'ngx-scrollbar/
',
'ng-signal-forms/**',
],
},

An error occured while server rendering /index.html:

NG0311: Directive CdkMenuTrigger does not have an input with a public name of brnMenuTriggerFor.

i keep getting this error

here is my component where i use it in:

template: `
    <div class="flex w-full items-center justify-center">
      <button hlmBtn variant="ghost" align="end" [brnMenuTriggerFor]="menu">
        <hlm-icon name="lucideUser" class="w-6 h-6" />
      </button>
    </div>
    <ng-template #menu>
      <hlm-menu class="w-56 bg-primary-dark text-white border-none">
        @if (user) {
          <hlm-menu-label>Welcome, {{ user.globalName }}</hlm-menu-label>
          <hlm-menu-separator class="bg-gray-600" />

          <hlm-menu-group>
            <button hlmMenuItem class="hover:cursor-pointer">
              <hlm-icon name="lucideUser" hlmMenuIcon />
              <span>Profile</span>
            </button>
          </hlm-menu-group>
          <hlm-menu-separator class="bg-gray-600" />
          <button
            hlmMenuItem
            (click)="logout.emit()"
            class="hover:cursor-pointer">
            <hlm-icon name="lucideLogOut" hlmMenuIcon />
            <span>Logout</span>
          </button>
        } @else {
          <button
            hlmMenuItem
            (click)="login.emit()"
            class="hover:cursor-pointer">
            <hlm-icon name="lucideLogIn" hlmMenuIcon />
            <span>Login</span>
          </button>
        }
      </hlm-menu>
    </ng-template>
  `,

when i remove the [brnMenuTriggerFor] directive, everything just works, but i need the brnmenutriggerfor

fierce sun
#

Based on the example from the docs, it feels like you need to use this input with other directives, not 'hlmBtn'.

wraith plaza