Skip to content

Instantly share code, notes, and snippets.

@Serabe
Created March 23, 2018 00:01
Show Gist options
  • Save Serabe/8e674001c73db34d206f107d99c40fd9 to your computer and use it in GitHub Desktop.
Save Serabe/8e674001c73db34d206f107d99c40fd9 to your computer and use it in GitHub Desktop.
Concatenated properties in contextual components
import Ember from 'ember';
export default Ember.Component.extend({
classNames: ['green-border']
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
body {
margin: 12px 16px;
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-size: 12pt;
}
.blue-background {
background-color: blue;
}
.red-color {
color: red;
}
.green-border {
border-color: green;
border-style: solid;
}
<h1>Welcome to {{appName}}</h1>
<br>
<br>
<p>
blue-background is not concatenated to red-color, but overwritten by it. red-color is still concatenated with green-backgroun
</p>
{{#with (component "my-component" classNames="blue-background") as |comp|}}
{{#with (component comp classNames="red-color") as |nestedComp|}}
{{component nestedComp}}
{{/with}}
{{/with}}
<br>
<br>
{
"version": "0.13.0",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "2.16.2",
"ember-template-compiler": "2.16.2",
"ember-testing": "2.16.2"
},
"addons": {
"ember-data": "2.16.3"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment