using angular functions to replace the standard JS ones