I have a quick question.
This is my code, and problem with it is when i run some emojis thro this it displays them as ?, cause it cuts the emoji in half.
angular.module('Joe.filters').filter("initials", function() {
return function(string) {
if (string) {
var words = string.split(" ");
if (words.length) {
string = words[0].charAt(0);
if (words[1]) {
string += words[1].charAt(0);
}
}
}
return string;
};
});
Now, im thinking if i can solve this with toArray, and if yes, how? Note: if i run in console the "fix" with array.
j = '';
""
j.length
2
s = _.toArray(j)
[""]
s.length
1
Thanks in advance!!