Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- app.controller("ProductController", ['$scope','$http', function($scope,$http) {
- $scope.fetch=function() {
- var responsePromise = $http.get("http://localhost:8080/rest/getAllProducts/");
- responsePromise.success(function (data, status, headers, config) {
- $scope.products = data;
- });
- }
- $scope.search=function(){
- $scope.products = "";
- var responsePromise = $http.get("http://localhost:8080/rest/getAllProducts/"+$scope.keyword);
- responsePromise.success(function (data, status, headers, config) {
- $scope.products = data;
- $scope.q = data;
- });
- }
- }]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement