For a project I'm working on, we want to create an offer module where users can generate an offer from dynamic values. This module has a preview in html and can be downloaded as an pdf version, which is sent to a customer.
A html page is generated with all the data provided. This is done with ng-model
in the view. Next we simulate multiple pages with jQuery by checking for each element if it is outside a page (each page has a min and max-height of 29,7cm). This functionality is already fixed, so we know this works.
The problem is that we want to check, when a user types in the textarea
, if the textarea flows outside the page and if so, we want to cut the textarea
where the overflow is happening and create a new textarea
with jQuery and fill it with the remaining characters with ng-model
.
We've looked into splitting all characters into an array, but no luck so far with incorporating this into the ng-model
. First approach, Second approach
So the question is, is it possible to check if the overflow happens and if so, create a new textarea with the same ng-model
? Any help is greatly appreciated.