Displaying User Reputation0:00
I now want to display a user's reputation level somewhere on the page. Now, of course, we can do it on their profile, but for this video, where can we put it? Maybe just over here to the right, at least to start. Or maybe even next to their name. I'm not sure. Let's try. So let's say threads.show. Here's where we show a thread. Now here is the thread question. This is the display for editing the question. So down here is where we view the question. And then, yeah, here is the link. So here is this section right here. So maybe, let's see, we have our anchor tag. And then, yeah, if their experience was something like that, refresh. That's not horrible. So how can we grab the dynamic value? It would be the thread.creator.reputation. So come back, give that a refresh, and they have 10. If we go to JohnDoe, I think he has a little bit more. He has 20. But if he were to add, whoops,
Adding Computed Reputation2:31
Actually, this is a good point. We haven't yet installed any of our npm dependencies. You can do that with npm install. Finally, I will boot up our watcher, because we'll probably make some additional changes. Okay, but yeah, if I were to come back to Chrome, it doesn't look very good, but we can see his number of points there. So let's see, how can we clean this up? How about within the h1, we'll have the user's name, and then in small tags, the user's reputation. Yeah, so let's get rid of that. We'll come back, give it a refresh, 36. And you know what? Why don't we make this a computed property? reputation. So here, I can say return this user's reputation plus XP for experience. Yeah, you know what? That's fine to get us started. We're going to have a full wave or a full chapter where we actually add some design to this form, because we've ignored it almost entirely up until this point. But yeah, it wasn't that hard to add the
