Skip to content

Instantly share code, notes, and snippets.

@renatocantarino
Last active August 29, 2015 14:02
Show Gist options
  • Save renatocantarino/5783ae4033882893ad50 to your computer and use it in GitHub Desktop.
Save renatocantarino/5783ae4033882893ad50 to your computer and use it in GitHub Desktop.
HTML angularJS controller
<!DOCTYPE html>
<html ng-app>
<head>
<title>TRABALHANDO COM CONTROLLERS</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script>
<script type="text/javascript" src="contatos.js"> </script>
</head>
<body>
<div ng-controller='ContatoController'>
Nome : <input type="text" ng-model='novo' />
<button ng-click='adicionar()'> Salvar</button>
<h2>Lista de contatos</h2>
<ul>
<li ng-repeat="item in contatos"> {{ item}} </li>
</ul>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment