I have created a custom directive which will check conditions and either display buttons or not in my HTML .When I apply it in html it is not working
My directive looks like this
angular.module('cmAuthorizeMdl',[])
.directive('cmAuthorizeDir', [function() {
retu {
enter code hererestrict: 'EA',
link: function(scope, element, attrs) {
//console.log(scope.policyDetails.policyBasic.policyPledged);
scope.$on('authorizationData',function(event, data){
var isPolicyPledge = data.policies.policyList.authorization.pledge;
var isPolicyPortfolio = data.policies.policyList.authorization.portfolio;
var isIncompleteSavings =data.policies.policyList.authorization.inCompleteSaving;
var isIrrevocableBeneficiaryClause = data.policies.policyList.authorization.irrevocableBeneficiaryClause;
var isUSRestricted=data.policies.policyList.authorization.usresctrict;
if(isPolicyPledge){ if(scope.policies.policyList.authorization.authRules['policy.pledgerule'].editable === true){ //show as it is } else{ element.css("display", "none");
}
}
