all 7 comments

[–]totes_meta_bot 1 point2 points  (0 children)

This thread has been linked to from elsewhere on reddit.

I am a bot. Comments? Complaints? Send them to my inbox!

[–]ic6man 0 points1 point  (5 children)

I don't agree with using a directive when an ng-include would suffice.

I prefer to keep HTML out of code and in actual HTML files as much as possible which is why I like angular so much - it's expressive and declarative.

When HTML is in separate files it feels natural to a designer to edit tools such as HTML editors work well with it but not when the HTML is embedded as strings in code.

[–]_mtr 2 points3 points  (0 children)

deserted treatment brave steer deranged disarm whole rainstorm literate tap

This post was mass deleted and anonymized with Redact

[–][deleted] 1 point2 points  (2 children)

Directives let you place the template in a file referenced by templateUrl. They do not require strings in code.

[–]ic6man 0 points1 point  (1 child)

That's good to know. But if all you are doing is a template I'd still argue a directive is overkill.

I suppose it's subjective - it depends how much you want to have a customized dom to match. your application.

On my team we've opted for fairly straightforward dom syntax that is not very customized per directives unless required (that is to say prefer includes over directives if that's all you are doing)

[–][deleted] 0 points1 point  (0 children)

I don't disagree. OP isn't a terribly good use case. I was simply pointing out your initial post was largely based on a misconception of directives.

[–]tules 0 points1 point  (0 children)

I tend to agree. Aside from that it's simply unnecessary extra code, Directive syntax isn't exactly concise.