diff --git a/www/js/controllers.js b/www/js/controllers.js index 72ac7eb..8a28133 100644 --- a/www/js/controllers.js +++ b/www/js/controllers.js @@ -4,14 +4,25 @@ angular.module('jsconfuy.controllers', []) }) -.controller('SpeakersCtrl', function($scope, $http, Speakers) { +.controller('SpeakersCtrl', function($scope, $http, Speakers, $ionicLoading) { $scope.speakers = []; + $ionicLoading.show({ + template: 'Loading...' + }); + Speakers.get() .then(function(speakers){ $scope.speakers = speakers; + $ionicLoading.hide(); },function(err){ + $ionicLoading.hide(); }); + + $scope.goToUrl = function(url){ + //use inAppBrowser plugin + window.open(url, '_blank', 'location=yes'); + } }) .controller('VenueCtrl', function($scope) { @@ -27,23 +38,49 @@ angular.module('jsconfuy.controllers', []) }) -.controller('AgendaCtrl', function($scope, Agenda) { +.controller('AgendaCtrl', function($scope, Agenda, $ionicLoading) { $scope.events = []; + $ionicLoading.show({ + template: 'Loading...' + }); + Agenda.get() .then(function(events){ $scope.events = events; + $ionicLoading.hide(); },function(err){ + $ionicLoading.hide(); }); }) -.controller('EventCtrl', function($scope, Agenda, $stateParams) { +.controller('EventCtrl', function($scope, Agenda, $stateParams, $ionicLoading) { var eventId = $stateParams.eventId; + $ionicLoading.show({ + template: 'Loading...' + }); + Agenda.getEvent(eventId) .then(function(event){ $scope.event = event; + $ionicLoading.hide(); },function(err){ + $ionicLoading.hide(); }); + $scope.shareEvent = function(event){ + var speakersText = ""; + + _.each(event.speakers, function(speaker, index){ + speakersText += speaker.name; + if((index+1) < event.speakers.length){ + speakersText += " & "; + } + }); + + var messageToShare = event.title + " by " + speakersText + " at #JSConfUY"; + window.plugins.socialsharing.share(messageToShare); + }; + }) diff --git a/www/templates/event.html b/www/templates/event.html index e16f452..e385c48 100644 --- a/www/templates/event.html +++ b/www/templates/event.html @@ -1,9 +1,19 @@ + + + {{event.type}} - + + +
+ +
+
+
+
By diff --git a/www/templates/speakers.html b/www/templates/speakers.html index b4e1225..7d8e9a7 100644 --- a/www/templates/speakers.html +++ b/www/templates/speakers.html @@ -14,8 +14,8 @@

{{speaker.name}}