Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
51 additions
and
16 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
generators/app/templates/js/features/common/filters/main.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/** | ||
* Entrance of common filters | ||
* | ||
* @author <%= answers.username %> | ||
* @date <%= answers.date %> | ||
* | ||
*/ | ||
import normalize from './normalize'; | ||
|
||
export default [normalize]; |
22 changes: 22 additions & 0 deletions
22
generators/app/templates/js/features/common/filters/normalize.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/** | ||
* Defines the normalize filter. | ||
* This filter used to convert CamelCase string into space separated words | ||
* | ||
* For Example: {{ 'SimpleTodoApp' | normalize }}, will print as: Simple Todo App | ||
* | ||
* @author <%= answers.username %> | ||
* @date <%= answers.date %> | ||
* | ||
*/ | ||
export default { | ||
type: 'filter', | ||
name: 'normalize', | ||
|
||
filterFactory: function() { | ||
'ngInject'; | ||
|
||
return function(input) { | ||
return input.replace(/([A-Z])/g, ' $1'); | ||
}; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters