diff --git a/examples/starters/flickr/index.html b/examples/starters/flickr/index.html index 5831901e85..e2f084d539 100644 --- a/examples/starters/flickr/index.html +++ b/examples/starters/flickr/index.html @@ -39,7 +39,7 @@
-
+
diff --git a/examples/starters/flickr/script.js b/examples/starters/flickr/script.js index 24a2009b3d..cf7d5bb302 100644 --- a/examples/starters/flickr/script.js +++ b/examples/starters/flickr/script.js @@ -20,7 +20,9 @@ angular.module('myApp', ['ionic', 'ngResource']) } } }) + .controller('FlickrCtrl', function($scope, Flickr) { + var doSearch = ionic.debounce(function(query) { Flickr.search(query).then(function(resp) { $scope.photos = resp; @@ -54,3 +56,12 @@ angular.module('myApp', ['ionic', 'ngResource']) } }) +.directive('photo', function($window) { + return { + restrict: 'C', + link: function($scope, $element, $attr) { + var size = ($window.outerWidth / 3) - 2; + $element.css('width', size + 'px'); + } + } +});