Ember Latest

The latest build of Ember.

by solex16

HTML

<script src="http://builds.emberjs.com/handlebars-1.0.0.js"></script>
<script src="http://builds.emberjs.com/ember-latest.js"></script>
<script src="https://raw.githubusercontent.com/kangax/fabric.js/master/dist/fabric.js"></script>
<script type="text/x-handlebars" data-template-name="application">
    <h1> ember - latest jsfiddle </h1>
    
    
    {{canvas-thing data=someControllerStuff}}
    {{input placeholder="Type some swagtastic text" value=someControllerStuff}}
</script>

CSS

html, body {
    margin: 20px;
}

JavaScript

App = Ember.Application.create({});

App.ApplicationController = Ember.ObjectController.extend({
    init: function () {
        this.set('someControllerStuff', 'WE ARE SWAGTASTIC');
    }
});


App.CanvasThingComponent = Ember.Component.extend({
    tagName: 'canvas',
    width: 400,
    height: 400,
    attributeBindings: ['width', 'height'],
    didInsertElement: function () {
    /*
    gotta set ctx here instead of in init because the element might not be in the dom yet in init
     */
        var canvas = new fabric.Canvas('c');
        
        var rect = new fabric.Rect({
            left:100,
            top: 100,
            fill: '#0000FF',
            hasBorders: true,
            width: 200,
            height: 200,
            opacity: 1,
        });

        
    canvas.add(rect);
    
        /*this.set('ctx',this.get('element').getContext('2d'));
        this._empty();
        */
    },
   
    
    
    
    

    _empty: function () {
    

        /*
           var ctx = this.get('ctx');
            ctx.fillStyle = '#f00';
           ctx.fillRect(0, 0, this.get('width'), this.get('height'));
            */
        
    }


    
});