Created
September 23, 2013 19:06
-
-
Save bulv1ne/6675313 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
<!doctype html> | |
<html> | |
<head> | |
<script src="http://code.jquery.com/jquery.min.js"></script> | |
<link href="http://getbootstrap.com/dist/css/bootstrap.css" rel="stylesheet" type="text/css" /> | |
<script src="http://getbootstrap.com/dist/js/bootstrap.js"></script> | |
<script src="http://knockoutjs.com/downloads/knockout-2.3.0.js"></script> | |
<script src="http://pagerjs.com/demo/pager.min.js"></script> | |
</head> | |
<body> | |
<p>Hello</p> | |
<p data-bind="text: dinges"></p> | |
<p><a href="#!/structure">Start</a></p> | |
<div data-bind="page: {id: 'start'}"> | |
start | |
</div> | |
<div data-bind="page: {id: 'structure', withOnShow: showFry}"> | |
structure | |
<div data-bind="text: a"></div> | |
<div data-bind="page: {id: 'dinges' }"> | |
dinges | |
</div> | |
</div> | |
</body> | |
</html> |
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
function ViewModel() { | |
var self = this; | |
self.dinges = ko.observable('Helloooo'); | |
self.showFry = function(callback, page){ | |
self.dinges('Loading data'); | |
console.log(callback); | |
console.log(page); | |
callback({a:'a'}); | |
} | |
} | |
viewModel = new ViewModel(); | |
pager.Href.hash = '#!/'; | |
pager.extendWithPage(viewModel); | |
// apply the view-model using KnockoutJS as normal | |
ko.applyBindings(viewModel); | |
// start pager.js | |
pager.start(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment