Untracked Config File

This commit is contained in:
Luke Vella 2015-01-27 17:56:21 +01:00
parent c74b397836
commit aaf75b4402
17 changed files with 234 additions and 147 deletions

View file

@ -1,13 +1,27 @@
angular.module('rallly')
.controller('EventCtrl', function($scope, $http, $state, Title, Event, ConfirmModal){
var id = $state.params.id;
// Get Event
$scope.event = Event.get({id:id}, function(data){
// Set the page title to the event title
Title.set($scope.event.title);
// Generate event url - i.e. http://rallly.co/jF9F_Fd
$scope.eventUrl = $state.href('event', {
id: $scope.event._id
}, {
absolute : true
});
var examplesNames = ['John Example', 'Jane Specimen','Mark Instance', 'Mary Case'];
$scope.event.examples = [];
for (var i = 0; i < examplesNames.length; i++){
var example = { name : examplesNames[i] };
example.dates = [];
for (var j = 0; j < $scope.event.dates.length; j++){
var answer = Math.random()<.5;
example.dates[j] = answer;
}
$scope.event.examples.push(example);
}
}, function(e){
$state.go('notfound');
});