/**
* Copyright (c) 2012, MEDIASTUTTGART, http://mediastuttgart.de
*
* This file is released under the terms of the MIT license.
* You can find the complete text in the attached LICENSE
* file or online at:
*
* http://www.opensource.org/licenses/mit-license.php
*/
/*global $, console, window, Ember */
/*jslint browser: true, maxerr: 50, indent: 4 */
(function () {
'use strict';
var App = {};
App.Util = Ember.Application.create();
// Settings
App.Util.Display = Ember.Object.create({
version : '0.1.0',
namespace : 'app.util.display'
});
// Model
App.Util.DisplayModel = Ember.Object.extend({
id : null,
age : 43,
name : 'Alex'
});
// View
App.Util.DisplayView = Ember.View.extend({
tagName : '',
templateName : 'display'
});
// Controller
App.Util.DisplayController = Ember.ArrayController.create({
init : function () {
var model, view;
// Compile template
Ember.TEMPLATES.display = Ember.Handlebars.compile('<div class="event" id="event-{{unbound id}}"><h1>Hello, my name is {{unbound name}} and i am {{unbound age}} years old</h1></div>');
// Create model
model = App.Util.DisplayModel.create();
// Assign model data
model.set('id', 17);
model.set('age', 33);
model.set('name', 'Tom');
// Create view
view = App.Util.DisplayView.create({
id : model.get('id'),
age : model.get('age'),
name : model.get('name')
});
// Append view
view.append();
}
});
}());
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.