client/app/app.js
changeset 2 36ccc573af9a
parent 1 74bbdd739878
child 4 28208a0ad8b9
--- a/client/app/app.js	Thu Oct 02 13:24:57 2014 +0200
+++ b/client/app/app.js	Fri Oct 03 10:38:50 2014 +0200
@@ -15,8 +15,12 @@
       when('/slideshow/', {
           controller: 'slideshowCtrl',
           templateUrl: 'slideshow/slideshow.html'
-        }).
-      when('/slideshow/:iSlide', {
+      }).
+      /*when('/slideshow/:iSlide', {
+          controller: 'slideshowCtrl',
+          templateUrl: 'slideshow/slideshow.html'
+      }).*/
+      when('/slideshow/add/:searched', {
         controller: 'slideshowCtrl',
         templateUrl: 'slideshow/slideshow.html'
       }).
@@ -40,6 +44,22 @@
     // });
     .config(function($logProvider){
       $logProvider.debugEnabled(true);
+    })
+    .service('searchApi', function($resource, context) {
+        console.log('search 4',$resource, context);
+        this.searchResource = function(params){
+            return $resource(context.urls.searchUrl,  
+                {
+                    callback: 'JSON_CALLBACK'
+                },
+                {
+                    getJsonp: {
+                        method: 'JSONP',
+                        params: params,
+                        isArray: false
+                    }
+                }).getJsonp();
+        };
     });
 
 })();