I am attempting to display an ellipsis for the content within a div, along with a '...more' text. Additionally, I am working on using ng-click to show the full text when '....more' is clicked.
My goal is to add a hover class upon clicking, but I am facing difficulties in connecting the click event to reveal more text.
<div ng-controller="MyCtrl" id='divEllipseContainer' class="{{class}}" ng-click="showEllipseContent()">
Chandra is in office with his beautiful wife with sour cream on her face.
</div>
var myApp = angular.module('myApp',[]);
function MyCtrl($scope) {
$scope.class = "appEllipseContent";
$scope.showEllipseContent = function(){
if ($scope.class == "appEllipseContent")
$scope.class = "";
else
$scope.class = "appEllipseContent";
};
}
.appEllipseContent {
overflow: hidden;
white-space: nowrap;
-ms-text-overflow: ellipsis;
text-overflow: ellipsis;
width:200px;
}
.appEllipseContent:hover {
overflow: visible;
white-space: normal;
}