Angular throws "Error: Invalid argument." in IE
Your attempt to create a directive to inject elements into your string runs into a known bug in IE dealing appendChild
method. I was able to reproduce your error IE with your fiddle even after removing the <div>
appending completely.
Notice, that if you remove your div
concatenation completely, and attempt to return newText
in original form, you still get
Error: Invalid argument.
My "error invalid argument anonymous function call"
was being thrown from me doing the following on the code below.
Error:
<span data-ng-bind="name.first">{{name.first}}</span>
No Error:
<span data-ng-bind="name.first"></span>
Not an Angular answer (and an old question, I know), but I'd suggest you might be taking the wrong approach to the problem. Rather insert breaks (which would ruin any markup in the string for example), simply use the CSS text-overflow or overflow property.