Enyo Tutorial

Gopinagh.R

HTML

<div id="a"></div>
<div id="b"></div>
<div id= "c"></div>

JavaScript

enyo.kind({
    name: "tapBasic",
    kind: enyo.Control,
    components: [{
        name: "hello",
        content: "Hello From Enyo"
    }, {
        kind: "Button",
        content: "Click Me!",
        ontap: "helloTap"
    }],
    helloTap: function () {
        this.$.hello.addStyles("color: blue");
    }
});

var control = new enyo.Control({
  name: "HelloWorld",
  tag: 'p',
  content: 'Hello, World! Hi there!',
  style: 'color: green'
});

//control.renderInto(document.getElementById("c")); 
//control.renderInto(document.getElementById("b"));
control.renderInto(document.getElementById("a"));

// render two, they're small
//new tapBasic().renderInto(document.getElementById("a"));
new tapBasic().renderInto(document.getElementById("b"));
new tapBasic().renderInto(document.getElementById("c"));

var control2 = new HelloWorld({});