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
if (Meteor.is_client) { | |
Template.hello.greeting = function () { | |
return "Welcome to meteor-intro."; | |
}; | |
Template.hello.events = { | |
'click input' : function () { | |
// template data, if any, is available in 'this' | |
if (typeof console !== 'undefined') | |
console.log("You pressed the button"); |
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
<!doctype html> | |
<head> | |
<title>Ember test</title> | |
<script type="text/javascript" src="../lib/jquery.min.js"></script> | |
<script type="text/javascript" src="../lib/ember.min.js"></script> | |
</head> | |
<body> | |
<script type="text/x-handlebars"> | |
<img {{bindAttr src="Example.logo"}} alt="Logo"><br /> | |
<h1>{{ Example.name }}</h1> |
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
getTweets: function() { | |
var self = this; | |
var searchString = Example.get("searchString"); | |
var url = "http://search.twitter.com/search.json?callback=?&q=" + searchString; | |
$.getJSON(url, function(data) { | |
for (var i = 0; i < data.results.length; i++) { | |
self.addItem(Example.Item.create(data.results[i])); | |
}; | |
}) | |
} |
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
Example.ChangeQuery = Ember.TextField.extend({ | |
change: function() { | |
var value = this.get('value'); | |
Example.set("searchString", value); | |
Example.populate.getTweets(); | |
} | |
}); |
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
Example = Ember.Application.create({ | |
name: "Example Application", | |
logo: "http://sympodial.com/images/logo.png", | |
searchString: "%23EmberJS", | |
ready: function() { | |
Example.populate.getTweets(); | |
setInterval(function() { | |
Example.populate.getTweets(); | |
}, 2000); | |
}.observes("name") |
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
<script type="text/x-handlebars"> | |
<img {{bindAttr src="Example.logo"}} alt="Logo"><br /> | |
<h1>{{ Example.name }}</h1> | |
{{view Example.ChangeQuery id="new-todo" placeholder="#EmberJS"}} | |
{{#view Example.LoopingView id="looping-view" }} | |
{{#each Example.populate}} | |
<li>{{ from_user_name }} - {{ text }}!</li> | |
{{/each}} |
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
<!doctype html> | |
<head> | |
<title>Ember test</title> | |
<script type="text/javascript" src="../lib/jquery.min.js"></script> | |
<script type="text/javascript" src="../lib/ember.min.js"></script> | |
</head> | |
<body> | |
<script type="text/x-handlebars"> | |
<img {{bindAttr src="Example.logo"}} alt="Logo"><br /> | |
<h1>{{ Example.name }}</h1> |
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
<!doctype html> | |
<head> | |
<title>Ember test</title> | |
<script type="text/javascript" src="../lib/jquery.min.js"></script> | |
<script type="text/javascript" src="../lib/ember.min.js"></script> | |
</head> | |
<body> | |
<script type="text/x-handlebars"> | |
<img {{bindAttr src="Example.logo"}} alt="Logo"><br /> | |
<h1>{{ Example.name }}</h1> |
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
addItem: function(item) { | |
this.pushObject(item); | |
}, |
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
Example = Ember.Application.create({ | |
name: "Example Application", | |
logo: "http://sympodial.com/images/logo.png", | |
ready: function() { | |
Example.populate.getTweets(); | |
} | |
}); |