Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. define(["knockout", "jquery", "core/shared"], function(ko, $, shared){
  2.  
  3. function Dashboard(){
  4. var self = this;
  5. self.playerId = ko.observable();
  6. self.injuryId = ko.observable();
  7. self.playerName = ko.observable();
  8. self.load = function(){
  9. //...Usually an AJAX request to fetch preliminary data
  10. }
  11.  
  12. //Insert usual computeds, subscriptions, AJAX requests and then some
  13. self.playerId(shared.queryString.getByName("playerId"));
  14. self.injuryId(shared.queryString.getByName("injuryId"));
  15.  
  16. self.load();
  17. }
  18.  
  19. ko.applyBindings(new Dashboard(), document.getElementById("dashboard"));
  20. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement