angular filters ES6 refactoring
This commit is contained in:
1 parent
c3b095feb4
commit
a227082638
7 files changed
+26
-46
No files matched your search
@@ -0,0 +1,5 @@
|
||||
export default function(app) {
|
||||
app.filter('removeHashtags', () => {
|
||||
return string => string.replace(/(#[^\s]+)/g, '');
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,5 @@
|
||||
export default function(app) {
|
||||
app.filter('uppercaseFirst', () => {
|
||||
return string => string.charAt(0).toUpperCase() + string.slice(1);
|
||||
});
|
||||
};
|
||||
@@ -1,11 +0,0 @@
|
||||
/**
|
||||
* Created by tmshv on 21/11/14.
|
||||
*/
|
||||
|
||||
module.exports = function(app) {
|
||||
app.filter("removeHashtags", function () {
|
||||
return function(string) {
|
||||
return string.replace(/(#[^\s]+)/g, '');
|
||||
};
|
||||
});
|
||||
};
|
||||
@@ -1,11 +1,5 @@
|
||||
/**
|
||||
* Created by tmshv on 21/11/14.
|
||||
*/
|
||||
|
||||
module.exports = function(app) {
|
||||
app.filter("removeNewline", function () {
|
||||
return function(string) {
|
||||
return string.replace(/(\n)/g, ' ');
|
||||
};
|
||||
export default function(app) {
|
||||
app.filter('removeNewline', () =>{
|
||||
return string => string.replace(/(\n)/g, ' ');
|
||||
});
|
||||
};
|
||||
@@ -1,13 +1,7 @@
|
||||
/**
|
||||
* Created by tmshv on 21/11/14.
|
||||
*/
|
||||
|
||||
module.exports = function(app) {
|
||||
app.filter("strip", function () {
|
||||
return function(string) {
|
||||
return string
|
||||
.replace(/^\s+/, '')
|
||||
.replace(/\s+$/, '');
|
||||
};
|
||||
export default function (app) {
|
||||
app.filter('strip', () => {
|
||||
return string => string
|
||||
.replace(/^\s+/, '')
|
||||
.replace(/\s+$/, '');
|
||||
});
|
||||
};
|
||||
@@ -1,11 +0,0 @@
|
||||
/**
|
||||
* Created by tmshv on 21/11/14.
|
||||
*/
|
||||
|
||||
module.exports = function(app) {
|
||||
app.filter("uppercaseFirst", function () {
|
||||
return function(string) {
|
||||
return string.charAt(0).toUpperCase() + string.slice(1);
|
||||
};
|
||||
});
|
||||
};
|
||||
Reference in new issue
Block a user