Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- app.controller('gameplanController', ['currentAuth', '$scope', '$location', '$firebaseObject', '$firebaseArray', '$http', function (currentAuth, $scope, $location, $firebaseObject, $firebaseArray, $http) {
- var ref = firebase.database().ref("matches");
- var matchList = $firebaseObject(ref);
- matchList.$loaded().then(function (data) {
- $scope.checkIfDataExists = function () {
- var matchList = [];
- if(matchList.length === 0) {
- console.log("empty");
- $scope.checkIfDataExists = true
- } else {
- console.log("full");
- $scope.checkIfDataExists = false
- }
- };
- });
- }]);
- <button type="button" class="btn btn-default button-main" ng-disabled="checkIfDataExists">{{ gametable }}</button>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement