4 ms·
I see "components" as a slightly different way of thinking, where you're building a cohesive unit. There'll be coupling between template and code, because they
by dceddia 11y ago
I see "components" as a slightly different way of thinking, where you're building a cohesive unit. There'll be coupling between template and code, because they are by definition a single "thing." And they should be small in scope -- render a single bit of data, or have some other well-defined, small duty to perform.
Even in Angular, where we try to separate the template from its directive/controller, I don't think I've yet run into a case where I can just reuse a template with a different directive. And in fact, if I was about to do that, I should rethink my strategy (and probably just use the existing directive).