Skip to content

Instantly share code, notes, and snippets.

@edruder
Created September 7, 2017 18:46
Show Gist options
  • Save edruder/524ed7a9fa9f816bf0bf2ee92df6d181 to your computer and use it in GitHub Desktop.
Save edruder/524ed7a9fa9f816bf0bf2ee92df6d181 to your computer and use it in GitHub Desktop.
Ember Starter Kit // source http://jsbin.com/qivami
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Ember Starter Kit</title>
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.1/normalize.css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="http://builds.emberjs.com/tags/v2.12.0/ember-template-compiler.js"></script>
<script src="http://builds.emberjs.com/tags/v2.12.0/ember.debug.js"></script>
<style id="jsbin-css">
/* Put your CSS here */
html, body {
margin: 20px;
}
</style>
</head>
<body>
<script type="text/x-handlebars">
<h2>Welcome to Ember.js</h2>
{{outlet}}
</script>
<script type="text/x-handlebars" data-template-name="index">
{{test-bindings classNames="hb-one hb-two hb-three"}}
</script>
<script type="text/x-handlebars" data-template-name='components/test-bindings'>
Component's css classes: {{classes}}
</script>
<script id="jsbin-javascript">
App = Em.Application.create();
App.TestBindingsComponent = Em.Component.extend({
classNames: ['one','two','three'],
extraClasses: function() {
return ['extra-one', 'extra-two', 'extra-three'].join(' ');
}.property(),
classNameBindings: ['extraClasses'],
classes: function () {
return this.get('classNames').join(' ');
}.property()
});
</script>
<script id="jsbin-source-html" type="text/html"><!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Ember Starter Kit</title>
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.1/normalize.css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"><\/script>
<script src="http://builds.emberjs.com/tags/v2.12.0/ember-template-compiler.js"><\/script>
<script src="http://builds.emberjs.com/tags/v2.12.0/ember.debug.js"><\/script>
</head>
<body>
<script type="text/x-handlebars">
<h2>Welcome to Ember.js</h2>
{{outlet}}
<\/script>
<script type="text/x-handlebars" data-template-name="index">
{{test-bindings classNames="hb-one hb-two hb-three"}}
<\/script>
<script type="text/x-handlebars" data-template-name='components/test-bindings'>
Component's css classes: {{classes}}
<\/script>
</body>
</html>
</script>
<script id="jsbin-source-css" type="text/css">/* Put your CSS here */
html, body {
margin: 20px;
}
</script>
<script id="jsbin-source-javascript" type="text/javascript">App = Em.Application.create();
App.TestBindingsComponent = Em.Component.extend({
classNames: ['one','two','three'],
extraClasses: function() {
return ['extra-one', 'extra-two', 'extra-three'].join(' ');
}.property(),
classNameBindings: ['extraClasses'],
classes: function () {
return this.get('classNames').join(' ');
}.property()
});
</script></body>
</html>
/* Put your CSS here */
html, body {
margin: 20px;
}
App = Em.Application.create();
App.TestBindingsComponent = Em.Component.extend({
classNames: ['one','two','three'],
extraClasses: function() {
return ['extra-one', 'extra-two', 'extra-three'].join(' ');
}.property(),
classNameBindings: ['extraClasses'],
classes: function () {
return this.get('classNames').join(' ');
}.property()
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment