i want to hide element based on the flag value.
i am not able to hide <span class="hidemain">Email ID<b>:</b>
{{userprofile.useremail}} </span>
element even if fflag==202
corp.directive('pubpri',function(){
console.log("is this pubpri is called------");
var directive = {};
directive.restrict = 'A';
directive.scope = {
flag : '=flag',
fflag : '=fflag'
}
directive.link = function($scope, element, attributes) {
$scope.$watch('flag',function(newVal){
console.log("newVal----"+newVal);
if(newVal==false){
$(".makepubpri").hide();
$scope.$watch('fflag',function(newValue){
console.log("flag1 value----"+newValue)
if(newValue==202){
$(".hidemain").hide();
console.log("is it coming in 202------")
}else{
$(".hidemain").show();
}
})
}else{
$(".makepubpri").show();
}
})
};
return directive;
});
<div pubpri flag="userprofile.result" fflag="userprofile.pubpriEmail">
<span
class="hidemain">Email ID<b>:</b> {{userprofile.useremail}} </span>
<div
class="makepubpri">
<label
class="label-radio inline" style="padding-left: 850px ! important;">
<input
type="radio" name="pubpriemail" ng-model="userprofile.pubpriEmail"
value="201" >
<span
class="custom-radio"></span>
Public
</label>
<label
class="label-radio inline">
<input
type="radio" name="pubpriemail" ng-model="userprofile.pubpriEmail"
value="202">
<span
class="custom-radio"></span>
Private
</label>
</div>
<div>
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.