Duplicate of the function in input.js. 
Please note that during the build Angular concatenates all files together, so you need this function only once.