简体   繁体   English

如何在angular.js中使用带有代码的笑脸[即:-)]?

[英]how to use smilies with codes[i.e :-) ] in angular.js??

I am looking to attach smiles to my messages on a application. 我希望在应用程序上给我的消息加上微笑。 But I am unable to find the smiles in angular.js . 但是我无法在angular.js中找到微笑。 I am finding some like :smile: then the symbol comes. 我发现类似:smile的符号,然后符号出现。 But I want this to be done with codes like :-) , :-( then a smile and sad symbols needs to come respectively. 但我希望使用诸如:-),:-(这样的代码来完成此操作,然后分别需要一个微笑和一个悲伤的符号。

Thanks in advance. 提前致谢。

You will need to look for a angular module that adds emoji autocomeplete for textareas. 您将需要寻找一个能为文字区域添加表情符号自动完成功能的角度模块。

A couple of examples that may suit your need: 几个适合您需要的示例:

You are seeing them come through with :smile: because that's the emoji code for smily face. 您会看到它们带有:smile :,因为这是笑脸的表情符号代码。

Take a look at http://www.emoji-cheat-sheet.com/ 看看http://www.emoji-cheat-sheet.com/

But if you really wanted to you could write a angular filter that would replace anywhere you saw a ":-)" with a :smile: and then the other filters would render the emoji as you'd expect. 但是,如果您确实想要,可以编写一个角度过滤器,用:smile:替换您看到的“ :-)”处的任何地方,然后其他过滤器将按照您的期望渲染表情符号。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM