@@ -4,14 +4,25 @@ angular.module('jsconfuy.controllers', [])
44
55} )
66
7- . controller ( 'SpeakersCtrl' , function ( $scope , $http , Speakers ) {
7+ . controller ( 'SpeakersCtrl' , function ( $scope , $http , Speakers , $ionicLoading ) {
88 $scope . speakers = [ ] ;
99
10+ $ionicLoading . show ( {
11+ template : 'Loading...'
12+ } ) ;
13+
1014 Speakers . get ( )
1115 . then ( function ( speakers ) {
1216 $scope . speakers = speakers ;
17+ $ionicLoading . hide ( ) ;
1318 } , function ( err ) {
19+ $ionicLoading . hide ( ) ;
1420 } ) ;
21+
22+ $scope . goToUrl = function ( url ) {
23+ //use inAppBrowser plugin
24+ window . open ( url , '_blank' , 'location=yes' ) ;
25+ }
1526} )
1627
1728. controller ( 'VenueCtrl' , function ( $scope ) {
@@ -27,23 +38,49 @@ angular.module('jsconfuy.controllers', [])
2738} )
2839
2940
30- . controller ( 'AgendaCtrl' , function ( $scope , Agenda ) {
41+ . controller ( 'AgendaCtrl' , function ( $scope , Agenda , $ionicLoading ) {
3142 $scope . events = [ ] ;
3243
44+ $ionicLoading . show ( {
45+ template : 'Loading...'
46+ } ) ;
47+
3348 Agenda . get ( )
3449 . then ( function ( events ) {
3550 $scope . events = events ;
51+ $ionicLoading . hide ( ) ;
3652 } , function ( err ) {
53+ $ionicLoading . hide ( ) ;
3754 } ) ;
3855} )
3956
40- . controller ( 'EventCtrl' , function ( $scope , Agenda , $stateParams ) {
57+ . controller ( 'EventCtrl' , function ( $scope , Agenda , $stateParams , $ionicLoading ) {
4158 var eventId = $stateParams . eventId ;
4259
60+ $ionicLoading . show ( {
61+ template : 'Loading...'
62+ } ) ;
63+
4364 Agenda . getEvent ( eventId )
4465 . then ( function ( event ) {
4566 $scope . event = event ;
67+ $ionicLoading . hide ( ) ;
4668 } , function ( err ) {
69+ $ionicLoading . hide ( ) ;
4770 } ) ;
4871
72+ $scope . shareEvent = function ( event ) {
73+ var speakersText = "" ;
74+
75+ _ . each ( event . speakers , function ( speaker , index ) {
76+ speakersText += speaker . name ;
77+ if ( ( index + 1 ) < event . speakers . length ) {
78+ speakersText += " & " ;
79+ }
80+ } ) ;
81+
82+ var messageToShare = event . title + " by " + speakersText + " at #JSConfUY" ;
83+ window . plugins . socialsharing . share ( messageToShare ) ;
84+ } ;
85+
4986} )
0 commit comments