Created
April 3, 2016 19:36
-
-
Save nctiggy/fce53552ebc0ca8cdae68511a7cedc38 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var app = angular.module('emcinv', ['ui.bootstrap','smart-table']); | |
app.controller('dropdown', function($scope,$http,GetInstallBase) { | |
$scope.selectedCustomer = "Select Customer"; | |
$http.get('customers.json').success(function(data) { | |
$scope.customerList = data; | |
}); | |
$scope.getInventory = function(customer) { | |
$scope.selectedCustomer = customer.name; | |
$scope.setIB = GetInstallBase.setIB(customer); | |
} | |
}); | |
app.controller('table', function($scope,GetInstallBase) { | |
$scope.safeInstallData = GetInstallBase.getIB(); | |
}); | |
app.factory("GetInstallBase", function($http) { | |
var IB = {val: null}; | |
function getIB() { | |
return IB; | |
} | |
function setIB(customer) { | |
$http.get('http://pnwreport.bellevuelab.isus.emc.com/api/installs/' + customer.id) | |
.success(function(data){ | |
IB.val = data['rows']; | |
}); | |
} | |
return { | |
getIB: getIB, | |
setIB: setIB | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment