feat(Template) Extract into external directives and add if directive