converting templates to js then including them in directives