Event view not displaying


#1

Hi there, I'm having trouble getting the event.html view to show the details for the event. Here is my code:

event.html

<div class="event-detail">
<h2 class="event-name"> {{ event.name }} </h2>
<p class="time"> <span class="from"> {{ event.to | date: "h:mma" }} </span> - <span class="to"> {{ event.to | date: "h:mma" }} </span></p>
<p class="where"> {{ event.where }} </p>
</div>

EventController.js

app.controller('EventController', ['$scope', '$routeParams', 'events', function($scope, $routeParams, events) {
events.success(function(data) {
$scope.event = data.events[$routeParams.id];
});
}]);

app.js

var app = angular.module('CalendarApp', ['ngRoute']);
app.config(function($routeProvider) {
$routeProvider
.when('/', {
controller: 'DayController',
templateUrl: 'views/day.html'
})
.when('/:id', {
controller: 'EventController',
template: 'views/event.html'
})
.otherwise({
redirectTo: '/'
});
});

I'm not sure what I am doing wrong. The events show up fine, but when I click on a event, it just shows the file name in text? Any help would be appreciated.


#2

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