Skip to content

Instantly share code, notes, and snippets.

@petrkotek
Forked from kirkbushell/filters.js
Last active August 29, 2015 14:15
Show Gist options
  • Save petrkotek/e602457def07b166c35e to your computer and use it in GitHub Desktop.
Save petrkotek/e602457def07b166c35e to your computer and use it in GitHub Desktop.
/**
* Sets a default value for a given input.
*
* @param mixed input
* @param string defaultValue
* @return string
*/
module.filter('default', function() {
return function(input, defaultValue) {
return input ? input : defaultValue;
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment