Skip to content

Instantly share code, notes, and snippets.

import Ember from 'ember';
export default Ember.Component.extend({
componentName: "inner-component",
actions: {
handleComponentChange() {
this.set('componentName', "second-component");
}
}
});
@tomdale
tomdale / README.md
Created September 8, 2013 05:40 — forked from mbostock/.block
@tomdale
tomdale / example.html
Created December 27, 2011 18:16 — forked from tdreyno/example.html
Live collection example in Ember
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Collection Example</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
MyApp.MyObj = SC.Object.extend({
type: "isString",
isString: function() {
return this.get('type') === 'isString';
}.property('type')
});
{{#collection "App.FieldsView" tagName="ul"}}
{{#with content}}
contentView: SC.SourceListView.design({
contentBinding: 'Authoring.reportTemplatesArrayController.content',
selectionBinding: 'Authoring.reportTemplatesArrayController.selection',
exampleView: SC.View.design({
classNames: 'sc-list-item-view'.w(),
childViews: 'nameLabel'.w(),
/**
Add 'sel' class in render method.
*/
render: function(context) {
// dynamically apply a mixin specified in an object property
var MyClass = SC.Object.extend({
extraMixin: null,
foo: "bar",
init: function() {
this.mixin(this.extraMixin);
arguments.callee.base.apply(this, arguments);
},
// ==========================================================================
// Project: Currencyconverter.converterController
// Copyright: ©2009 My Company, Inc.
// ==========================================================================
/*globals Currencyconverter */
/** @class
Converts one form of currency to another.