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


#1

(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

#2

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.


#3

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

EG

// 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.


#4

@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.


#5

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