Advertisement
Guest User

Untitled

a guest
Jan 14th, 2017
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1.  
  2. The HTML:
  3.  
  4. <div id="schedule-button-bar2" class="button-bar scheduleButtonBar">
  5. <button id="schedule-all" style="font-size:16px; background: transparent; color:#ff9c33" class="button button-calm " ng-click = "updateButtons('schedule-all'); data.filter=''">All Events</button>
  6. <button id="schedule-Games" style=" font-size:16px;" class="button button-calm" ng-click = "updateButtons('schedule-Games'); data.filter=({type:'Game'})">Games</button>
  7. <button id="schedule-Practice" style="font-size:15px;" class="button button-calm" ng-click = "updateButtons('schedule-Practice'); data.filter=({type:'Practice'})" Practices</but"ton>
  8.  
  9. </div>
  10.  
  11.  
  12. The Javascript:
  13.  
  14. indent preformatted text by 4 spaces
  15. .controller('scheduleCtrl', ['$scope', '$stateParams',
  16. function scheduleController ($scope, $stateParams) {
  17. $scope.data = {
  18. "filter" : "",
  19. "events": getEvents()
  20. // alert()
  21. };
  22. $scope.updateButtons = function(btn){
  23. document.getElementById('schedule-Practice').style = "background: opaque; "
  24. document.getElementById('schedule-all').style = "background: opaque; "
  25. document.getElementById('schedule-Games').style = "background: opaque; "
  26. document.getElementById(btn).style = " background: transparent ; color: #ff9c33"
  27. }
  28. }])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement