Demo entry 5865338

sample app

   

Submitted by panu on Aug 16, 2016 at 15:11
Language: JavaScript. Code size: 835 Bytes.

(function(){
'use strict';
    
    angular.module('flickrApp',['ngMaterial'])
    .controller('listController',['$scope','$http', function($scope,$http){
    $scope.results = [];
        
        $scope.isSearching = false;
    $scope.search = function(){
                $scope.isSearching = true;

    $http({
    method: 'GET',
    url: 'https://api.flickr.com/services/rest',
        params: {
        method: 'flickr.photos.search',
            api_key:'6fd053e2b464f9a76f701cee422c18a7',
text: $scope.searchTerm,
        format: 'json',
            nojsoncallback:1
        }
    
    }).success(function(data){
    
    $scope.results = data;
                $scope.isSearching = false;

        
    }).error(function(error){
    console.error(error)
            $scope.isSearching = false;

    });
    
    }
    }]);

})();

This snippet took 0.01 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).