Advertisement
Guest User

Untitled

a guest
Nov 21st, 2014
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. app.controller("ProductController", ['$scope','$http', function($scope,$http) {
  2.     $scope.fetch=function() {
  3.         var responsePromise = $http.get("http://localhost:8080/rest/getAllProducts/");
  4.         responsePromise.success(function (data, status, headers, config) {
  5.             $scope.products = data;
  6.         });
  7.     }
  8.  
  9.     $scope.search=function(){
  10.         $scope.products = "";
  11.         var responsePromise = $http.get("http://localhost:8080/rest/getAllProducts/"+$scope.keyword);
  12.         responsePromise.success(function (data, status, headers, config) {
  13.             $scope.products = data;
  14.             $scope.q = data;
  15.         });
  16.     }
  17.  
  18.  
  19. }]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement