From the course: Ember.js Essential Training

Unlock this course with a free trial

Join today to access over 22,400 courses taught by industry experts.

Component properties

Component properties

- [Narrator] Components in your Ember application are treated as black boxes. They are isolated from the rest of your Ember application so they have no knowledge of the data the rest of your application has access to. So this means you need to pass all of the properties the component will use directly to it. We've already seen the basic way of handling component properties by passing the email address and avatar URL to a component. Let's look at some of the other ways to handle component properties. First off, we can set properties from the component module itself. Open up the component module, for our users list component at app, components, users dash lists dot j s. Let's add in the component and attribute for the image class. We'll call this attribute image class and set it to the string avatar. So inside of our Ember.component.extend code block, we'll add image class colon and the string avatar. Next, we need to use our component property. Our component template will have access…

Contents