-
-
Save kubicek/4011065 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
font-family: Helvetica, Verdana | |
} | |
p { | |
padding: 7px 10px; | |
} | |
#demo { | |
border: 1px solid #999; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div ng-app ng-controller="FetchCtrl"> | |
ICO: <input type="text" ng-model="ico" ng-change="fetch()" size="80"/><button ng-click="fetch()">fetch</button><br> | |
DIC: <input type="text" ng-model="data.dic" size="80"/><br/> | |
firma: <input type="text" ng-model="data.firma" size="80"/><br/> | |
ulice: <input type="text" ng-model="data.ulice" size="80"/><br/> | |
mesto: <input type="text" ng-model="data.mesto" size="80"/><br/> | |
psc: <input type="text" ng-model="data.psc" size="80"/><br/> | |
<pre>http url: {{url}}</pre> | |
<pre>http status code: {{status}}</pre> | |
<pre>form data: {{data}}</pre> | |
</div> | |
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function FetchCtrl($scope, $http, $templateCache) { | |
$scope.method = 'GET'; | |
$scope.ico = "67787231"; | |
$scope.fetch = function() { | |
$scope.code = null; | |
$scope.data = null; | |
$scope.url = "http://www.lepsipraha7.cz/ares.php?ico=" + $scope.ico; | |
$http({ | |
method: $scope.method, | |
url: $scope.url, | |
cache: $templateCache | |
}).success(function(data, status) { | |
$scope.status = status; | |
$scope.data = data; | |
}).error(function(data, status) { | |
$scope.data = data || "Request failed"; | |
$scope.status = status; | |
}); | |
}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Request.HTML - jsFiddle/Gist integration demo | |
description: jsFiddle demo hosted on Gist using HTTP Request to get ARES data | |
authors: | |
- Jiri Kubicek | |
resources: | |
- /js/empty.js | |
- /css/normalize.css | |
normalize_css: no |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment