How can add a CSS class if a condition is met Angular JS
问题 I'm working on creating a truncate directive and I have the string of text truncating if the characters exceed 10. It will then display the "...". My Goal is to write a condition that removes the "..." if the characters are less than 10. Kind of stuck on this and open to suggestions if anyone has any ideas on how I could accomplish this. Here is my code: var app = angular.module('myApp', []); // Controller app.controller('mainCtrl', function($scope) { $scope.text = "John Doe Blah blah"; }); /