Opening a Clarity Signpost does not emit its state
Asked Answered
B

1

9

I am using the Clarity Signposts and need its state (whether its open or closed). I am using the *clrIfOpen structural directive and have assigned it the isOpen variable. isOpen is false initially but should update to true when the Signpost is open.

<clr-signpost>
    <clr-signpost-content *clrIfOpen="isOpen">
        <p>Signpost Content!</p>
        <span>Signpost State: {{isOpen}}</span>
    </clr-signpost-content>
</clr-signpost>

I also tried the clrIfOpenChange output on clrIfOpen but it too is not triggered when the signpost is opened.

Clarity Version: 0.10.0-rc.1

Plnkr: https://plnkr.co/edit/OQupObBd9OkJZSpOhpfq?p=preview

Bung answered 11/8, 2017 at 11:45 Comment(0)
C
6

I believe what you want to use is the de-sugared syntax of Angular structural directives to access the Output Emitter.

<clr-signpost>
  <ng-template [(clrIfOpen)]="isOpen">
    <clr-signpost-content>
      <p>Signpost Content!</p>
      <span>Signpost State: {{isOpen}}</span>
    </clr-signpost-content>
  </ng-template>
</clr-signpost>

Please refer to this Plnkr: https://plnkr.co/edit/SZNDZIiyomGWJsC7UsiC?p=preview

Complicate answered 11/8, 2017 at 12:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.