Answer the question
In order to leave comments, you need to log in
How to make the text received through foreach shorter?
How to make the text received through foreach shorter?
Here is the function:
$scope.minifyText = function (text, length) {
return text.slice(0, text.indexOf(' ', length)) + '...';
}
{{ market_name }}
Answer the question
In order to leave comments, you need to log in
var maxlength = 20;
$scope.cutString = function (text) {
if (text && text.length > maxlength) {
return text.substring(maxlength) + '...';
}
return text;
};
I'm not much of an expert, but still...
<ul id="navigation">
<li><a href="1.html" class="button">1</a></li>
<li><a href="2.html" class="button">2</a></li>
<li><a href="3.html" class="button">3</a></li>
</ul>
.button {
user-select: none;
display: block;
color: inherit;
text-decoration: none
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question