From the course: Learning Polymer

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Computed properties

Computed properties - Polymer Tutorial

From the course: Learning Polymer

Start my 1-month free trial

Computed properties

- [Instructor] In this example, we're going to see how to create a computed property in a Polymer element. And before we do that, again, let me just show you what the end result looks like. So we're in the exercise files folder here and I'm going to run the finished version. Alright. So in this example, I've taken the original temperature card and I've modified it to display the temperature in both the Fahrenheit and Celsius scales. And you can see that as I click on each button, the temperature is being updated for both scales at the same time. Alright, so let's stop this server and let's go look at the code. So here in the 05/04 start folder I'll open the index file first and just to show you that there's no changes. This stays the same as it's been up until now. So we're not going to make any edits in the index file. So, now let's take a look at the source code for temp card and here you can see in the layout I've got two one-way bindings. So the first is the one-way binding for…

Contents