Created
September 5, 2012 07:36
-
-
Save psykidellic/3632696 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| class @Santoor extends Backbone.View | |
| constructor: (@templateId) -> | |
| render: -> | |
| console.log @templateId | |
| template = _.template($(@templateId).html()) | |
| // if I remove the constructor part and use | |
| // template = _.template($("#santoor-player").html()) | |
| // it works | |
| console.log(template) | |
| $(@el).html(template) | |
| console.log(@el) | |
| @ | |
| >>> | |
| <script id="santoor-player" type="text/template" charset="utf-8"> | |
| <audio controls> | |
| <source src="Bolero.mp3"> | |
| Your fallback goes here. | |
| </audio> | |
| </script> | |
| <script type="text/javascript" charset="utf-8"> | |
| $(function() { | |
| var x = new Santoor("#santoor-player"); | |
| $("#main").append(x.render().$el); | |
| }); | |
| </script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment