Skip to main content
100%

Contextual Components for Drop Downs?

✓ Published0🌍 Public
RRandomEtc
Last edited Oct 19, 2016
Created on Oct 19, 2016

This example shows how to build a contextual dropdown component using Ember 2.9 and its component APIs, including `{{yield}}` with a hash, `(component ...)`, and `(action ...)`. The `drop-down` component yields a trigger and content subcomponent, passing the `closed` state to the content and a toggle action to the trigger. A button toggles a CSS class that hides or shows the content paragraph. The code uses Ember.Component extensions, `classNameBindings`, and `toggleProperty` to manage the open/closed state.

AI-generated description

Similar vizzes