Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.