I have a number of <div> tags and I'm assigning them a function that allows me to display a kind of modal with details from the <div> element by changing it's css propriety 'display' to 'block' instead of 'none'. for some reason the modal doesn't display when I click on the <div> element. but when I assign the same function to a button it does.
$scope.CountryDetailStyle = {
'display': 'none'
};
$scope.CountryDetail = function(idCount, nameCount, descCount) {
$scope.detailId = idCount;
$scope.detailName = nameCount;
$scope.detailDesc = descCount;
$scope.CountryDetailStyle = {
'display': 'block'
};
// alert('idCount : '+idCount+' nameCount : '+nameCount+' descCount : '+descCount);
}
<div id="pageContent" ng-controller="myAdminController">
<div class="countries" ng-repeat="country in countries" title="{{country.descCount}}" ng-click="CountryDetail(country.idCount, country.nameCount,
country.descCount)">
<label> {{country.nameCount}} </label><br/>
<img ng-src="uploads/{{country.image}}" alt="Image Not Found"><br>
</div>
</div>
<div>
<button ng-click="CountryDetail(country.idCount, country.nameCount,
country.descCount)" style="display:block; float:right; clear:both;">Display Country Detail</button>
</div>
<div class="countryDetails" ng-style=CountryDetailStyle>
<!--this is the modal i want to display -->
<div class="content">
<div class="boxHeader">
<label>{{detailName}}</label>
</div>
<div class="boxContent">
<form>
<p>{{detailDesc}}</p>
<a href="#" class="btn" style="text-decoration:none;">Read More</a>
</form>
</div>
</div>
</div>
can someone tell me what's the problem? thanks.
div class="countryDetails"is outside thedivcontaining theng-controllerdirective.