Skip to content

Instantly share code, notes, and snippets.

@nctiggy
Created April 3, 2016 19:36
Show Gist options
  • Save nctiggy/fce53552ebc0ca8cdae68511a7cedc38 to your computer and use it in GitHub Desktop.
Save nctiggy/fce53552ebc0ca8cdae68511a7cedc38 to your computer and use it in GitHub Desktop.
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