The Path to Contextual Components: Contextual Components

Contextual components are introduced in Ember.js 2.3 to improve component composition and the usage of components for DSL. Contextual components bring three new features to Ember: The hash helper: this simple helper just returns a hash with the attributes passed to it. Closure components: similar to closure actions, a closure component encapsulates a component with …

Read moreThe Path to Contextual Components: Contextual Components

The Path to Contextual Components: Understanding dynamic components

The component helper allows the user to render a component based on a given name. Given these two components: {{! app/templates/components/first-component }} This is first-component {{name}} {{! app/templates/components/second-component }} This is second-component {{name}} We can render dynamically any of them with the following invocation: {{component componentToRender name=’Sergio’}} The first parameter contains the name of the …

Read moreThe Path to Contextual Components: Understanding dynamic components