Last active
December 12, 2015 07:58
-
-
Save DavertMik/4739990 to your computer and use it in GitHub Desktop.
BatmanJS dynamic counters
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
class YourApp.User extends Batman.Model | |
@resourceName: 'user' | |
@storageKey: 'users' | |
@classAccessor 'invitesAvailable', -> | |
# for simplicity we use jQuery to grab a limit from a page | |
$('#invite_limit').val() - @get('loaded').toArray().length |
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
Invites left: <span data-bind="User.invitesAvailable"></div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment