add javascript snippets for directives and console.log