Created
October 11, 2014 14:22
-
-
Save toast38coza/665ace19d8b322f9335d to your computer and use it in GitHub Desktop.
The smallest amount of code to demonstrate the power of AngularJS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Hello</title> | |
</head> | |
<body ng-app="HelloWorldApp" > | |
<div ng-controller="HelloController" class="container" > | |
<div ng-repeat="message in messages" > | |
<input ng-model="message.msg" /> {{ message.msg }} | |
</div> | |
</div> | |
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> | |
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script> | |
<script> | |
var HelloController = function($scope) { | |
$scope.messages = [ | |
{"msg": "Hello!"}, | |
{"msg": "Hola!"}, | |
{"msg": "Bonjour!"} | |
] | |
}; | |
// register our controller/s | |
angular.module('HelloWorldApp.controllers', []) | |
.controller("HelloController", HelloController); | |
// this is our global app: | |
angular.module('HelloWorldApp', ['HelloWorldApp.controllers']); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment