# HG changeset patch # User cavaliet # Date 1412332916 -7200 # Node ID 18a4c598ddee8a5f2ff0561cb6325d126786e5b4 # Parent 36ccc573af9a7494dd6a6f45a05c968b0fb11426 common data for gallery and slideshow diff -r 36ccc573af9a -r 18a4c598ddee client/app/gallery/gallery_controller.js --- 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; }); })(); diff -r 36ccc573af9a -r 18a4c598ddee client/app/index.html --- 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" } diff -r 36ccc573af9a -r 18a4c598ddee client/data/gallery.json --- 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 diff -r 36ccc573af9a -r 18a4c598ddee client/data/slideshow.json --- 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": [ {