create a directive for the template node