A
A
Alexander Kovalchuk2015-07-16 13:00:49
Angular
Alexander Kovalchuk, 2015-07-16 13:00:49

How to count how many rows a user has written using Angular?

Is it possible with Angular to count how many lines a user has written in a textarea element, or how can this be done gracefully by other means?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yuri Mostovoy, 2015-07-16
@mamut

<body ng-app>
    <textarea ng-model="text"></textarea>
    <span>{{text.split('\n').length}} lines</span>
</body>

jsfiddle.net/2q6xh00z

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question