Advertisement
Guest User

Untitled

a guest
Aug 24th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. app.controller('gameplanController', ['currentAuth', '$scope', '$location', '$firebaseObject', '$firebaseArray', '$http', function (currentAuth, $scope, $location, $firebaseObject, $firebaseArray, $http) {
  2.  
  3. var ref = firebase.database().ref("matches");
  4. var matchList = $firebaseObject(ref);
  5.  
  6. matchList.$loaded().then(function (data) {
  7.  
  8. $scope.checkIfDataExists = function () {
  9. var matchList = [];
  10.  
  11. if(matchList.length === 0) {
  12. console.log("empty");
  13. $scope.checkIfDataExists = true
  14. } else {
  15. console.log("full");
  16. $scope.checkIfDataExists = false
  17. }
  18.  
  19. };
  20.  
  21. });
  22.  
  23. }]);
  24.  
  25. <button type="button" class="btn btn-default button-main" ng-disabled="checkIfDataExists">{{ gametable }}</button>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement