Last active
December 23, 2015 17:29
-
-
Save JonMidhir/6668921 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 ShiftDock.Views.RotasIndex extends Backbone.View | |
| # ... | |
| initialize: -> | |
| @collection.on 'fetched', @render, this | |
| render: -> | |
| # ... | |
| # ... |
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 ShiftDock.Routers.Rotas extends Backbone.Router | |
| # ... | |
| index: (year, week) -> | |
| @collection.fetch | |
| success: (collection, response) => | |
| collection.trigger('fetched') | |
| # ... |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is probably not ideal, comes from way back when I started porting the thing over to Backbone. Nothing wrong with triggering custom events, it's just that I'm sure there must be a built in fetch event somewhere.