Knockout.jsを勉強していて、そのチュートリアルデモ「Twitterクライアント」(これはコードへのリンクです)を作成しようとしましたが、まったく機能しません!
私のコードはここにあります:
http://jsfiddle.net/weed_7777/ZZJbv/
私のCoffeeScriptコードは次のとおりです。
root = exports ? this
class root.Twitter
constructor: ->
@tweets = []
$.getJSON('http://search.twitter.com/search.json?callback=?&rpp=100&q=%40weed_7777')
.done((data) =>
$.each data.results, (i, item) =>
@tweets.push item
)
root = exports ? this
class root.TweetListView
constructor: ->
twitter = new Twitter
@currentTweets = ko.computed =>
twitter.tweets
ko.applyBindings new TweetListView
$(".loadingIndicator").ajaxStart ->
$(@).fadeIn()
.ajaxComplete ->
$(@).fadeOut()
ご親切にありがとうございます。