1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- 'use strict';
- * @ngdoc function
- * @name domainManagerApp.controller:AboutCtrl
- * @description
- * # AboutCtrl
- * Controller of the domainManagerApp
- */
- angular.module('domainManagerApp.domains', ['ui.bootstrap', 'firebase'])
- .controller('DomainsListController',['$scope', '$firebase', function ($scope, $firebase) {
-
-
-
-
-
-
- $scope.domains = [];
-
- var ref = new Firebase("https://j1x-cpanel.firebaseio.com/domains");
- ref.on("child_added", function(data) {
- if(!$scope.$$phase) {
- $scope.$apply(function(){
- $scope.domains.push(data.val());
- });
- }
- }, function (errorObject) {
- console.log("The read failed: " + errorObject.code);
- });
- $scope.oneAtATime = false;
- $scope.isOpen = false;
- $scope.labelColor = function(status) {
- if (status == "OK"){
- var color = "label-success";
- } else if (status == "DEAD") {
- var color = "label-danger";
- } else {
- var color = "label-default";
- }
- return color;
- }
- }]);
|