Skip to content

Instantly share code, notes, and snippets.

@ASH-Michael
Last active January 6, 2020 22:04
Show Gist options
  • Save ASH-Michael/e211c6b30365ddf9fc89a6a5bfce3dc7 to your computer and use it in GitHub Desktop.
Save ASH-Michael/e211c6b30365ddf9fc89a6a5bfce3dc7 to your computer and use it in GitHub Desktop.
Component Namespacing
import Ember from 'ember';
export default Ember.Component.extend({
classNames: ['addon-component']
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
/* SITE STYLES */
body {
margin: 12px 16px;
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-size: 12pt;
}
/* APP STYLES */
p {
color: blue;
}
/* ADDON STYLES */
.addon-component p {
padding: 0 0.5rem;
color: white;
background: blue;
}
<p>Paragraph in parent app.</p>
{{addon-component}}
<p>Paragraph in parent app.</p>
{{addon-component}}
<p>Paragraph in addon-component.</p>
{
"version": "0.15.1",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js",
"ember": "3.4.3",
"ember-template-compiler": "3.4.3",
"ember-testing": "3.4.3"
},
"addons": {
"ember-data": "3.4.2"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment