var myapp = angular.module('myApp', []); myapp.controller("HttpPostController", function ($scope, $http) { $scope.SendHttpPostData = function () { var data = $.param({ stnm: $scope.stateName, }); var statename = document.getElementById("stnm").value; var config = { headers : { 'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8;' } } if(statename==='AP') //here I want to handle for all states using else if condition. $http.get('https://myurl', data, config) .success(function (data, status, headers, config) { $scope.ServerResponse = data.records; }) .error(function (data, status, header, config) { }); }; });
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)