Inconsistency with Angular expressions

问题内容:

For some reason in my events.html

the function getEvents() is called an it does:

ng-repeat="event in events ... "

<p>{{event.venue.name}}</p>

which produces the appropriate text, but in my event_details.html the function getEvent() is called as it lists particular details.

<li class="list-group-item">Venue: {{event.venue.name}}</li>

produces absolutely nothing.

whilst

<li class="list-group-item">Name: {{event.venue}}</li>

produces the venueID

I’d greatly appreciate some help!

问题评论:

1  
Please provide a Minimal, Complete, and Verifiable example that reproduces issue
    
If event.venue renders text, how can there even be a property event.venue.name?
    
That’s what I’m really confused about. In events.html the event.venue is an object with venueID as a property, whilst in event_details event.venue Is the venueID.
– Sid Jones
1 hour ago
    
Sounds like different data sources for separate instances
    
Terribly sorry. I forgot to populate the venue in the eventSchema. I’m really new to MEAN stack. Once again, apologies.
– Sid Jones
1 hour ago

原文地址:

https://stackoverflow.com/questions/47755320/inconsistency-with-angular-expressions

添加评论