I have a scenario where when click i am changing the border color from black to red by append a class to a div using ng-class.
But when i click a button the modal is getting triggered but the class is not getting appended.
<div ng-class="{'addBorder':clicked}" class="beforeClicked">
<button ng-click="clickToOpen()">My Modal</button>
</div>
function MyCtrl($scope, ngDialog) {
$scope.clicked=false;
$scope.clickToOpen = function () {
$scope.clicked=true;
ngDialog.open({ template: 'templateId' });
};
}
.addBorder{
border:1px solid red;
}
.beforeClicked{
width:100px;
height:300px;
border:1px solid black
}
Here the div is already in black border when click on button i am making the flag true which should add class addBorder to the div which appends red color border.
But it isn't happening.
Any help would be appreciated.