What is the best way of showing a very long text (in MBs) using ui-scroll ? The text is available in the form of an array but needs to be displayed as a long text document just like a textarea. I'm using ui-scroll as each word in the text is a clickable anchor tag.
Is ui-scroll-td to display each word as a column and lines as row the only way ?
More Information
- I have a large array containing > 2000 elements (words) which can be changed by user dynamically (both the number of elements and the element itself).
I need to display these elements as a single document where each element (word) is a hyperlink which when clicked performs certain action.
I need it to look like a simple scrollable div which has these words displayed as long free flowing clickable text.
I was using $compile earlier to create html dynamically but the initial compile time and the compile upon element change is very significant (seconds) as I have to compile/render the whole list of elements every single time.
So I thought of using ui-scroll to display which virtualizes and renders only the displayed content.
But ui-scroll always display each element in a separate line like a row which is not the desired behavior for my use case.
Input:
myList = ["Hello", "World", "This", "is", "my", "first", "dream"].
desired Output (each word in same line with auto wrap just like a div):
<div>
<span ng-repeat="w in myList">
<a ng-click="someAction()">myList[$index]</a>
</span>
</div>
Hello World This is my first dream
ui-scroll:
<div>
<span ui-scroll="at in info">
<a id="at-{{$index}}" ng-click="someAction($index, $event)">
myList[$index]}}
</a>
</span>
</div>
ui-scroll output (each word in separate line):
Hello
World
This
is
my
first
dream
Kindly note that each word above is a clickable anchor. Thanks.