unserver-unify
Version:
26 lines • 857 B
JavaScript
;
angular.module('bamboo').controller('PricingDlgCtrl', function(ApiService, CommonService, $uibModalInstance, loginService) {
var self = this;
this.pricingRecords = {};
self.currency = (loginService.school.currency&&loginService.school.currency.sign)?loginService.school.currency.sign:'$';
function getAllPlans()
{
var info = {
limit: 4,
action: 'getEnabledUserPlans',
sort:{predicate: "price", reverse: false}
};
ApiService.post("/transaction", info).then(function(result) {
console.log(result);
if(result.data.success) {
self.planRecords = result.data.data.items;
} else {
CommonService.showError("Failed: " + result.data.message);
}
});
}
getAllPlans();
this.choosePlan = function(id){
$uibModalInstance.close(id);
}
});