3. Routing III - Views, upvotes and pubdate is not showing on the browser


<Below this line, add a link to the EXACT exercise that you are stuck at.>

<In what way does your code behave incorrectly? Include ALL error messages.>
When i click one of the links, the photo is there but the texts(views, upvotes & pubdate) aren’t. Here is my code:

{{ photos.title }}

{{ photos.author}}

{{ photos.views | number }}

{{ photos.upvotes | number }}

{{ photos.pubdate | date }}

What should i do? Is there anything that i can? Please help me out. Thanks in advance everyone! :slight_smile:

Naa… I/we can’t see your code. Please, post code using the code format(ter) < / >. Else, it automatically reads and display code.

Thank you! :slight_smile:

Hello, here it is:

<div class="photo">
  <div class="container">
    <img ng-src="{{ detail.url }}">
    <h2 class="photo-title"> {{ photos.title }} </h2>
    <p class="photo-author"> {{ photos.author}} </p>
    <p class="photo-views"> {{ photos.views | number }} </p>
    <p class="photo-upvotes"> {{ photos.upvotes | number }} </p>
    <p class="photo-pubdate"> {{ photos.pubdate | date }} </p>


If we are on the same page here, these code posted should be in photo.html right?

So, to get the views and up votes by tim gage showing up after you click by tim gage, your code should be:

<div class="photo">
  <div class="container">
    <img ng-src="{{ detail.url }}">
    <h2 class="photo-title"> {{ detail.title }} </h2>
    <p class="photo-author"> by {{ detail.author }} </p>
    <p class="photo-views"> {{ detail.views | number }} views </p>
    <p class="photo-upvotes"> {{ detail.upvotes | number }} upvotes </p>
    <p class="photo-pubdate"> {{ detail.pubdate | date  }} </p>

Because you want to use the number filter to format the views and upvotes. I have also included how you use the date filter to format the pubdate.

I hope this resolves. :slight_smile:

1 Like

It’s working! You’re a lifesaver. Thank you very much! :slight_smile:

You’re welcome.

Have fun coding! :slight_smile:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.