UNPKG

unserver-unify

Version:

30 lines 840 B
'use strict'; angular.module('bamboo.additional').controller('ServicesCtrl', function(ApiService, $stateParams) { var self = this; this.id = $stateParams.id || ''; console.log(this.id); this.defaultPhoto = 'assets/images/news_no-image1.jpg'; this.photoPath = ApiService.SHOST + '/advinfo/'; function getInfo() { ApiService.get("/productinfo/" + self.id).then(function(result) { console.log(result); if (result.data.success) { self.productDet = result.data.data; } }); } if(this.id!=''){ getInfo(); } var info = { start: 0, limit: 10, type: 'school', action: "getProductInfos" }; ApiService.post('/advinfo', info).then(function(result) { if (result.data.success) { self.productsList = result.data.data.items; } }); });