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


#1

<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<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:


#2

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:


#3

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>
  </div>
</div>

Result:


#4

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>
  </div>
</div>

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:


#5

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


#6

You’re welcome.

Have fun coding! :slight_smile:


#7

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