angular-http-status
Version:
AngularJS stuff to easily convert status text into its HTTP code and vice versa
74 lines (64 loc) • 3.27 kB
HTML
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
<script type="application/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script>
</head>
<body ng-app="demo-angular-http-status">
<div class="container">
<div class="jumbotron">
<h1>Angular HTTP Status</h1>
<p class="lead">There is no revolution here, just a convenience stuff to deal with HTTP Status codes</p>
<p>
<a class="btn btn-lg btn-success" href="https://github.com/yllieth/angular-http-status" role="button">
<i class="fa fa-github"></i>
Installation details on github
</a>
</p>
</div>
<div class="row marketing" ng-controller="demoCtrl as Demo">
<div class="col-lg-8">
<h4 style="margin-bottom: 20px">Interactive conversions</h4>
<div class="row" style="margin-bottom: 20px">
<div class="col-lg-2">Code</div>
<div class="col-lg-6"><input type="number" ng-model="Demo.code" style="width: 100%" /></div>
<div class="col-lg-4">means <code>{{ Demo.toString(Demo.code) }}</code></div>
</div>
<div class="row" style="margin-bottom: 20px">
<div class="col-lg-2">Status text</div>
<div class="col-lg-6"><input type="text" ng-model="Demo.text" style="width: 100%" /></div>
<div class="col-lg-4">is status <code>{{ Demo.toStatus(Demo.text) }}</code></div>
</div>
<div class="row" style="margin-top: 20px; border-top: 1px solid lightgrey ; padding-top: 20px">
<div class="col-lg-12">
This angular module comes with 2 elements:
<ul>
<li>an angular constant (<code>HttpCodes</code>) with the list you can see right here</li>
<li>an angular factory (<code>HttpStatus</code>) with a convenience method <code>toString()</code></li>
</ul>
</div>
</div>
<div class="row" style="margin-top: 20px; border-top: 1px solid lightgrey ; padding-top: 20px">
<div class="col-lg-12">
Codes and status text are from <a href="http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml">http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml</a>.
<br/><br/>
This list only contains HTTP status with an existing RFC (see comments within the code).
</div>
</div>
</div>
<div class="col-lg-4">
<h4>Complete list</h4>
<pre>{{ Demo.statusCodes | json }}</pre>
</div>
</div>
<footer class="footer">
<p>© Yllieth 2015</p>
</footer>
</div>
<script type="application/javascript" src="../angular-http-status.js"></script>
<script type="application/javascript" src="app.js"></script>
</body>
</html>