0

I am trying to get number of rows from the text that gets inject into text area, for some reason I can't get textarea to initalize number of row, here's my code. What am I doing wrong?

<div class="form-group col-sm-12">
        <textarea contenteditable="true" 
                  rows="'iwofRecord.WhatHasBeenDone.split('\n').lenght'" 
                  class="form-control form-control-plain" 
                  ng-model="iwofRecord.WhatHasBeenDone" 
                  placeholder="What Has Been Done">
        </textarea>
</div>

2 Answers 2

2

rows is not an Angular attribute, wrap that in {{}} - you're also double quoting that attribute (and have length spelled wrong)

rows="{{iwofRecord.WhatHasBeenDone.split('\n').length}}"
Sign up to request clarification or add additional context in comments.

1 Comment

You're awesome and I am such an immigrant :-)!
2

.lengHT - there is a typo, it has to be .length

1 Comment

You're awesome and I am such an immigrant :-)!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.