Last active
August 29, 2015 14:06
-
-
Save webOS101/fc80269608520e7d0b0a to your computer and use it in GitHub Desktop.
Enyo Data Source Sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enyo.ready(function() { | |
enyo.AjaxSource.create({ name: 'ajax' }); | |
var collection = new enyo.Collection({ | |
source: 'ajax', | |
url: 'https://api.github.com/users/enyojs/repos' | |
}); | |
enyo.kind({ | |
name: 'RepoView', | |
kind: 'DataRepeater', | |
collection: collection, | |
components: [{ | |
components: [{ name: 'name' }], | |
bindings: [ | |
{ from: 'model.name', to: '$.name.content' } | |
] | |
}] | |
}); | |
new enyo.Application({ name: 'app', view: 'RepoView' }); | |
collection.fetch(); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Data Source Example | |
description: An example of Enyo data sources | |
authors: | |
- Roy Sutton | |
normalize_css: no |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Try it out on jsFiddle
From: Enyo: Up and Running by Roy Sutton