Half baked directives.js code