Arpit Gupta
Arpit Gupta

Reputation: 1

how to access angular js $rootscope in spring java application

$rootScope.loadAccountSubjects = function() {
    if($rootScope.shaAccountId == undefined || $rootScope.shaAccountId == null) {
        $rootScope.shaAccountId  = $("#userInfo_userAccountId").val();
    }
    //console.log("in MenuController");
    WidgetInfoService.getLandingPageByWidgetId({widgetId: $rootScope.widgetId}, function(response) { 
        var data = response.data;
        if(data != null) {
            $rootScope.institutionalPDAllowedStatus = data.allowInstitutionalPD;
            $rootScope.isProxyEnable = data.isProxyEnabled;
            $rootScope.isProxyRequestHealthDoc = data.canRequestHealthDoc;
            $rootScope.canAccessPrivacyPreferences = data.canAccessPrivacyPreferences;
            $rootScope.isPrivacySettingBannerSet = data.isPrivacySettingBannerSet;
            $rootScope.isContactBannerSet = data.isContactBannerSet;
            $rootScope.portalName = data.landingPageName; 
            $rootScope.portalNickName = data.nickName; 
            $scope.portalDateCreated = data.dateCreated;
            $rootScope.pinRequired = data.pinRequired;

            $rootScope.updatePrivacyPrefrences = data.updatePrivacyPrefrences;


            /*for show-hide header*/
            $rootScope.mydata = data.mydata;
            $rootScope.documents = data.documents;
            /*for show-hide header*/



            $rootScope.setting_groups["1"] = "1_"+$rootScope.portalName;
            $scope.lastUpdatedPreferenceDate = data.lastDateUpdatedForPreferences;
            $scope.lastUpdatedAuthorizeAccountDate = data.lastDateUpdatedAuthorizeAccount;
            $scope.lastUpdatedHealthDocumentDate = data.lastDateUpdatedHealthDocuments;

            if(data.isMaleProfileImage && data.maleProfileImageName != null) {
                $rootScope.defaultMaleProfileImage = $rootScope.amazonawsImgContextPath + "profileImage/" + data.maleProfileImageName; 
            }

            if(data.isFemaleProfileImage && data.femaleProfileImageName != null) {
                $rootScope.defaultFemaleProfileImage = $rootScope.amazonawsImgContextPath + "profileImage/" + data.femaleProfileImageName; 
            }

        }
    });
};

i want to use $rootScope.mydata = data.mydata; $rootScope.documents = data.documents; these two variables in jsp page in ng-if how can i use it

<li id="mydata_id" class="link"  onclick="changecolor('2')" ng-click="pleaseLoadViewAnswer();"><a href="javascript:;" data-toggle="collapse" data-target=".navbar-collapse.in"><i class="fa fa-database"  ng-if="mydata"></i><span>My Data</span></a></li>

i want to use $rootScope.mydata = data.mydata; $rootScope.documents = data.documents; these in above html file

Upvotes: 0

Views: 120

Answers (0)

Related Questions