我如何修剪()在angularjs字符串?字符串、angularjs

2023-09-13 03:49:35 作者:我想把钱包打肿来

有一个角特定的方式?如果不是这样,我应该使用内置的jQuery来做到这一点?如果我应使用内置jQuery中我该如何去修剪()函数不使用$(或者是必需的)?

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 $ (or is that necessary)?

编辑 - 是的,我知道str.trim()。抱歉。我需要这个IE 8中工作。

Edit - Yes I know about str.trim(). Sorry. I need this to work in IE 8

编辑 - 至于这个问题是一个重复的,我是问具体怎么做到这一点的角度,其中所引用的回答解释了如何做到这一点在JavaScript中,节点和jQuery。有没有办法使用内置jQuery中的角度做呢?

Edit - As far as this question being a duplicate, I am asking specifically how to do this in angular where the answer referenced explains how to do it in javascript, node and jquery. Is there a way to do it using the built in jquery in angular?

编辑 - 很显然,答案是AngularJS并没有做到这一点

Edit - Apparently the answer is "AngularJS doesn't do this"

推荐答案

如果你只需要的显示的剪裁后的值,那么我建议对操纵原始字符串并使用的

 
精彩推荐