@@ -4,14 +4,25 @@ angular.module('jsconfuy.controllers', [])
4
4
5
5
} )
6
6
7
- . controller ( 'SpeakersCtrl' , function ( $scope , $http , Speakers ) {
7
+ . controller ( 'SpeakersCtrl' , function ( $scope , $http , Speakers , $ionicLoading ) {
8
8
$scope . speakers = [ ] ;
9
9
10
+ $ionicLoading . show ( {
11
+ template : 'Loading...'
12
+ } ) ;
13
+
10
14
Speakers . get ( )
11
15
. then ( function ( speakers ) {
12
16
$scope . speakers = speakers ;
17
+ $ionicLoading . hide ( ) ;
13
18
} , function ( err ) {
19
+ $ionicLoading . hide ( ) ;
14
20
} ) ;
21
+
22
+ $scope . goToUrl = function ( url ) {
23
+ //use inAppBrowser plugin
24
+ window . open ( url , '_blank' , 'location=yes' ) ;
25
+ }
15
26
} )
16
27
17
28
. controller ( 'VenueCtrl' , function ( $scope ) {
@@ -27,23 +38,49 @@ angular.module('jsconfuy.controllers', [])
27
38
} )
28
39
29
40
30
- . controller ( 'AgendaCtrl' , function ( $scope , Agenda ) {
41
+ . controller ( 'AgendaCtrl' , function ( $scope , Agenda , $ionicLoading ) {
31
42
$scope . events = [ ] ;
32
43
44
+ $ionicLoading . show ( {
45
+ template : 'Loading...'
46
+ } ) ;
47
+
33
48
Agenda . get ( )
34
49
. then ( function ( events ) {
35
50
$scope . events = events ;
51
+ $ionicLoading . hide ( ) ;
36
52
} , function ( err ) {
53
+ $ionicLoading . hide ( ) ;
37
54
} ) ;
38
55
} )
39
56
40
- . controller ( 'EventCtrl' , function ( $scope , Agenda , $stateParams ) {
57
+ . controller ( 'EventCtrl' , function ( $scope , Agenda , $stateParams , $ionicLoading ) {
41
58
var eventId = $stateParams . eventId ;
42
59
60
+ $ionicLoading . show ( {
61
+ template : 'Loading...'
62
+ } ) ;
63
+
43
64
Agenda . getEvent ( eventId )
44
65
. then ( function ( event ) {
45
66
$scope . event = event ;
67
+ $ionicLoading . hide ( ) ;
46
68
} , function ( err ) {
69
+ $ionicLoading . hide ( ) ;
47
70
} ) ;
48
71
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
+
49
86
} )
0 commit comments