var ATLAS_ANATOMY = 'Atlas Anatomy'; var CLINICAL_ILLUSTRATION = 'Clinical Illustrations'; var CLINICAL_ANIMATION = 'Clinical Animations'; var OpenedModuleItemList = []; var ModDetail = []; var moduleData; var modName; AIA.service('ModuleService', function($http, DataService) { return { loadModuleDataBasedOnModuleName: function(moduleName) { var jsonPath; modName = moduleName; if (moduleName == ATLAS_ANATOMY) { jsonPath = '~/../content/data/json/aa/aa_dat_contentlist.json'; } else if (moduleName == CLINICAL_ANIMATION) { //to do, in next phase of project jsonPath = '~/../content/data/json/ca/ca_dat_contentlist.json'; } else if (moduleName == CLINICAL_ILLUSTRATION) { //to do, in next phase of project jsonPath = '~/../content/data/json/ci/ci_dat_contentlist.json'; } return $http.get(jsonPath, function (response) { moduleData = new jinqJs() .from(response.data.root.Item) .orderBy([{field: '_Title', sort: 'asc' }]) .select(); // console.log(JSON.stringify(response, null, 4)); // response.data= moduleData; // return response.data; return moduleData; }); }, GetOpenedTileData: function (id,moduleJson) { if (modName == ATLAS_ANATOMY) { var AADataForSelectedItem = []; var title = id; alert(moduleJson.data.root.Item.length); var selectedTileData = new jinqJs() .from(moduleJson.data.root.Item) .where("_Title == " + title) .select(); AADataForSelectedItem.push("imageId: " + selectedTileData[0]._ImageId); AADataForSelectedItem.push("BodyRegion:" + selectedTileData[0]._BodyRegion); AADataForSelectedItem.push("BodySystem: " + selectedTileData[0]._BodySystem); AADataForSelectedItem.push("ImageName: " + selectedTileData[0]._ImageName); AADataForSelectedItem.push("ImageType:" + selectedTileData[0]._ImageType); AADataForSelectedItem.push("TileImageName: " + selectedTileData[0]._TileImageName); AADataForSelectedItem.push("ViewOrientation: " + selectedTileData[0]._ViewOrientation); return AADataForSelectedItem; } //OpenedModuleItemList.push("imageId: " + moduleDetails[0]); //OpenedModuleItemList.push("moduleId:" + moduleDetails[1]); //OpenedModuleItemList.push("moduleName: " + moduleDetails[2]); //var moduleId = moduleDetails.moduleId; //OpenedModuleList.push(moduleId); //OpenedModuleList.tileViewId = moduleDetails.TileViewId; //OpenedModuleList.tileImageName = moduleDetails.imageName; //OpenedModuleList.tileImageSRC = moduleDetails.imagePath; //moduleData.push($scope.moduleId); //moduleData.push(value._Id); //moduleData.push(value._ImageId); //moduleData.push(value._Title); //moduleData.push(value._ImageName); //moduleData.push(value._BodySystem); //moduleData.push(value._BodyRegion); //moduleData.push(value._ViewOrientation); //moduleData.push(value._ImageType); //moduleData.push(value._TileImageName); console.log('called service'); //this.renderModuleItemById(); }, }; });