Is there an angular specific way? If not, should I use the built in jquery to do it? If I should use the built in jquery how do I get to the trim() function without using $ (o
Why don't you simply use JavaScript's trim():
str.trim() //Will work everywhere irrespective of any framework.
For compatibility with use:
use:
if(typeof String.prototype.trim !== 'function') { String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g, ''); } }
Found it Here