ModuleService.js 2.14 KB
var ATLAS_ANATOMY = 'Atlas Anatomy';
var CLINICAL_ILLUSTRATION = 'Clinical Illustrations';
var CLINICAL_ANIMATION = 'Clinical Animations';
var OpenedModuleItemList = [];

AIA.factory('ModuleService', function ()
{   
    return {
        SaveOpenedModules: function (moduleDetails)
        {
            OpenedModuleItemList.push("moduleId: "+ moduleDetails[0]);
            OpenedModuleItemList.push("Id:" + 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();          
            
        },

        renderModuleItemById : function () {
        
            var jsonFileForOpenModule;

            if (OpenedModuleItemList[2] == ATLAS_ANATOMY)
            {
               this.loadPinData();
            
            }
            else if (OpenedModuleItemList[2] == CLINICAL_ANIMATION) {

            }
            else if (OpenedModuleItemList[3] == CLINICAL_ILLUSTRATION) {

            }

        },
        loadPinData: function ()
        {
            var pinJsonFile = "~/../content/data/json/aa/aa_pin_data/" + OpenedModuleItemList.imageID;
            alert('pinJsonFile: ' + pinJsonFile);   
        }
        
    };

 
   
});