-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhttp.html
43 lines (42 loc) · 1.03 KB
/
http.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<!DOCTYPE html>
<html ng-app="MyFirstApp">
<head>
<meta charset='utf-8'/>
<title>Hola mundo con AngularJS</title>
<style>
.animated{
opacity: 1;
max-height: auto;
overflow: hidden;
transition: all 2s;
}
.animated.ng-hide{
opacity: 0;
max-height: 0px !important;
overflow: hidden;
display: block !important;
}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.7/angular.min.js"></script>
<script src='http.js'></script>
</head>
<body ng-controller="FirstController">
<dl>
<dt>Titulo</dt>
<dd><input type='text' name='title' ng-model='newPost.title'/></dd>
<dt>Cuerpo</dt>
<dd><textarea name='body' ng-model='newPost.body'></textarea></dd>
</dl>
<button ng-click='addPost()'>Enviar</button>
<div ng-show="loading">Cargando...</div>
<div ng-hide="loading || posts.length > 0">No se encontraron resultados</div>
<ul ng-show="posts.length > 0" class='animated'>
<li ng-repeat="post in posts">
<h2>{{post.title}}</h2>
<p>
{{post.body}}
</p>
</li>
</ul>
</body>
</html>