...

/

Which Template Approach Is the Best?

Which Template Approach Is the Best?

Let's explore the pros and cons associated with each template approach.

Which template approach is the best? This is a difficult question to answer since both approaches have their pros and cons.

External template approach

Let’s see the pros and cons of the external template approach.

Pros

The external template approach allows us to separate out the view of our component, which we can expand on by using separation of concerns, where each file has one single job that it is responsible for. The component class has all the business logic of our component, while the template HTML file has all the UI elements for the component and the CSS file styles for the UI of the component.

Cons

The drawback of using the external approach ...