davidlav
davidlav

Reputation: 688

Difference between Component and Custom Element in Aurelia

I'm trying to understand the difference between the terms Component and Custom Element in the context of Aurelia.

From the docs, "components are composed of view and view-model pairs" (i.e. an HTML and a JS/TS file). Is a "custom element" just the view (HTML file) half of that combination? Or does a custom element also consist of a view and a view-model?

Upvotes: 0

Views: 801

Answers (1)

Benny Halperin
Benny Halperin

Reputation: 2332

Component is the model and view-model pair. It defines an Aurelia component. Quoting from their site: Components are the basic building blocks of all Aurelia applications. Custom element is the HTML custom element that can be included in the app's markup like <my-element>. It is defined in the component. Custom as opposed to the standard HTML elements such as <div>, <p> etc.

See

Upvotes: 0

Related Questions