#0| Moving global method from app.js to message directive