Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save goooooouwa/7d221f7fec87fa86d0db to your computer and use it in GitHub Desktop.
Save goooooouwa/7d221f7fec87fa86d0db to your computer and use it in GitHub Desktop.
render added style on added tenderers for the selected package. This feature is useless after package selection is replaced by company search bar, since no concept of selected package any more.
$scope.companiesLoaded = function(){
angular.forEach($scope.selectedPackage.tenderers, function(tenderer, key){
var matchedCompanies = $.grep($scope.companies, function(company){ return (company.id == tenderer.company_id); });
if( matchedCompanies.length > 0){
matchedCompanies[0].selected = true;
matchedCompanies[0].added = true;
}
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment