Ember.js - Coming Soon in Ember Octane - Part 2: Angle Brackets & Named Arguments

(This post was originally published on www.pzuraq.com)

This is a companion discussion topic for the original entry at https://emberjs.com/blog/2019/02/19/coming-soon-in-ember-octane-part-2.html

The only thing I’ve found strange with Angle Bracket components so far is dynamic components using the {{component}} helper cannot be converted to angle bracket notation.

Also quick note about positional params: @ef4 had a cool point that positional params just assign named params, so if you know the target name of positional params, you can still use angle bracket components.

Also I’ve found it kinda tough to get used to the fact that class is no longer merged if you’re using splattributes.


// my-component.hbs
<div ...attributes class='internal-class'>

// using my-component elsewhere
<MyComponent class='purple' />
// result is <div class='purple'>

I guess if you want things merged they need to be passed as args not attributes, which is fine. Just something to get used to.

@shull just make sure you put ...attributes at the end if you want them to be merged.

<div class="internal-class" ...attributes> will have the intended effect.

1 Like

Wow! That is zero percent what I would have expected. Thanks!

1 Like