Skip to content

Instantly share code, notes, and snippets.

@renatocantarino
Created May 6, 2014 01:37
Show Gist options
  • Save renatocantarino/68919e3e5206393fce3f to your computer and use it in GitHub Desktop.
Save renatocantarino/68919e3e5206393fce3f to your computer and use it in GitHub Desktop.
index da app
<!DOCTYPE html>
<!-- diretiva ng-app -->
<html ng-app="diretivasAng">
<head>
<meta charset="utf-8" />
<title> Diretivas</title>
<script>
document.write('<base href="' + document.location + '" />');
</script>
<link rel="stylesheet" href="style.css" />
<script data-require="[email protected]" src="http://code.angularjs.org/1.2.1/angular.js" data-semver="1.2.1"></script>
<script src="app.js"></script>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-theme.min.css">
<!-- Latest compiled and minified JavaScript -->
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<title>Diretivas</title>
</head>
<!-- define um controller para este trecho da tela -->
<!-- diretiva ng-controller -->
<body ng-controller="dirController">
<div class="container theme-showcase">
<h1>Salada de Frutas</h1>
<ul class="list-group">
<!-- diretiva ng-repeat -->
<li class="list-group-item" ng-repeat="fruta in frutas">{{fruta.name}}
| Eu gosto! <input type="checkbox" ng-model="gostei" />
<!-- diretiva ng-show -->
<span class="glyphicon glyphicon-thumbs-up" ng-show="gostei"></span></li>
</ul>
<p>
<!-- diretiva ng-submit -->
<form ng-submit="addFrutasSalada()">
<!-- diretiva ng-model -->
<input type="text" ng-model="nomeFruta" placeholder="Nome da fruta" />
<input type="submit" value="Incluir" />
</form>
</p>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment