Skip to content

Instantly share code, notes, and snippets.

@DinisCruz-Dev
Created March 1, 2014 19:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DinisCruz-Dev/9295707 to your computer and use it in GitHub Desktop.
Save DinisCruz-Dev/9295707 to your computer and use it in GitHub Desktop.
Simple AngularJS app with Firebug lite
<!DOCTYPE html>
<html ng-app>
<head>
<meta charset="UTF-8">
<title>Angular example (with Firebug lite)</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.13/angular.min.js"></script>
<script src="https://getfirebug.com/firebug-lite-debug.js" ></script>
<link href ="http://angularjs.org/css/bootstrap.min.css" rel="stylesheet" ></link>
</head>
<script type="text/javascript">
function ContactController($scope)
{
$scope.contacts = ["userA@owasp.org", "userB@owasp.org"];
$scope.add = function()
{
$scope.contacts.push($scope.newcontact);
$scope.newcontact = "";
}
}
</script>
<body ng-controller = "ContactController">
<div class = "hero-unit">
<h4>New Contact:</h4>
<form class = "form-horizontal"
ng-submit = "addTodo()" >
<input type = "text"
size = "30"
placeholder = "Add new email here"
ng-model = "newcontact" />
<button class = "btn btn-primary"
ng-click = "add()" >Add</button>
</form>
<h4>Current Contacts</h4>
<ul>
<li ng-repeat = "contact in contacts">{{ contact }} </li>
</ul>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment