Slide 26
Slide 26 text
1 App.initializer
2 name: "setup-play-link-handler",
3 initialize: (container, application) ->
4 trackController = container.lookup('controller:track')
5
6 $('body').on 'click', 'a.play', (e) ->
7 $link = $(this)
8 artist = $link.data('artist')
9 title = $link.data('title')
10 videoId = # Search YouTube for the video
11
12 track = Ember.Object.create
13 artist: artist
14 title: title
15 videoId: videoId
16
17 trackController.set('content', track)