common data for gallery and slideshow
authorcavaliet
Fri, 03 Oct 2014 12:41:56 +0200
changeset 3 18a4c598ddee
parent 2 36ccc573af9a
child 4 28208a0ad8b9
common data for gallery and slideshow
client/app/gallery/gallery_controller.js
client/app/index.html
client/data/gallery.json
client/data/slideshow.json
--- a/client/app/gallery/gallery_controller.js	Fri Oct 03 10:38:50 2014 +0200
+++ b/client/app/gallery/gallery_controller.js	Fri Oct 03 12:41:56 2014 +0200
@@ -9,23 +9,9 @@
           controller: 'galleryCtrl'
         });
     })
-    .service('galleryApi', function($resource, context) {
-      this.gallery = $resource(context.urls.galleryUrl);
-    })
-    .service('galleryModel', function(galleryApi, context) {
-      console.log('4', context.gallery);
-      if(typeof context.gallery === 'undefined') {
-        console.log('4-1');
-        this.gallery = galleryApi.gallery.get();
-      }
-      else {
-        console.log('4-2');
-        this.gallery = new galleryApi.gallery(context.gallery);
-      }
-    })
-    .controller('galleryCtrl', function($scope, $location, galleryModel){
-      console.log('5',$scope, $location, galleryModel);
-      $scope.gallery = galleryModel.gallery;
+    .controller('galleryCtrl', function($scope, $location, slideshowModel){
+      console.log('gallery 5',$scope, $location, slideshowModel);
+      $scope.gallery = slideshowModel.slideshow;
     });
 
 })();
--- a/client/app/index.html	Fri Oct 03 10:38:50 2014 +0200
+++ b/client/app/index.html	Fri Oct 03 12:41:56 2014 +0200
@@ -57,7 +57,6 @@
               record: angular.fromJson('{"record": "record value"}'),
               urls: {
                   base_static: "./",
-                  galleryUrl: "data/gallery.json",
                   slideshowUrl: "data/slideshow.json",
                   searchUrl: "http://ammico.labs.exalead.com/search-api"
               }
--- a/client/data/gallery.json	Fri Oct 03 10:38:50 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-{
-  "title": "bae0704f-b0e1-11e2-8479-c8bcc896c290",
-  "description": "description DESC",
-  "images": [
-    {
-      "id": "im001",
-      "title": "im 1 ceci est un titre très très long vraiment très très très long",
-      "url": "data/images/ImageAccueilCM1.jpg"
-    },
-    {
-      "id": "im002",
-      "title": "im 2",
-      "url": "data/images/ImageAccueilCM2.jpg"
-    },
-    {
-      "id": "im003",
-      "title": "im 3",
-      "url": "data/images/ImageAccueilCM3.jpg"
-    },
-    {
-      "id": "im004",
-      "title": "im 4",
-      "url": "data/images/ImageAccueilCM4.jpg"
-    },
-    {
-      "id": "im005",
-      "title": "im 5",
-      "url": "data/images/ImageAccueilCM5.jpg"
-    },
-    {
-      "id": "im006",
-      "title": "im 6",
-      "url": "data/images/ImageAccueilCM6.jpg"
-    },
-    {
-      "id": "im007",
-      "title": "im 7",
-      "url": "data/images/ImageAccueilCM7.jpg"
-    },
-    {
-      "id": "im008",
-      "title": "im 8",
-      "url": "data/images/ImageAccueilCM8.jpg"
-    },
-    {
-      "id": "im009",
-      "title": "im 9",
-      "url": "data/images/ImageAccueilCM3.jpg"
-    },
-    {
-      "id": "im010",
-      "title": "im 10",
-      "url": "data/images/ImageAccueilCM8.jpg"
-    }
-  ]
-}
\ No newline at end of file
--- a/client/data/slideshow.json	Fri Oct 03 10:38:50 2014 +0200
+++ b/client/data/slideshow.json	Fri Oct 03 12:41:56 2014 +0200
@@ -1,5 +1,5 @@
 {
-  "title": "titre de mon slideshow",
+  "title": "Ma sélection d'images",
   "description": "description DESC SLIDESHOW BEST EvER",
   "images": [
     {