Skip to content

Instantly share code, notes, and snippets.

@fritzvd
Created April 29, 2015 07:38
Show Gist options
  • Save fritzvd/f82e65c5d2c31ec00943 to your computer and use it in GitHub Desktop.
Save fritzvd/f82e65c5d2c31ec00943 to your computer and use it in GitHub Desktop.
controller in the html
<html>
<body ng-app="myApp">
<div ng-controller="MyFavoriteCtrl as ctrl">
{{ ctrl.superspecialvar }}
</div>
<script>
// initiate module, first argument is the name, second are dependencies
angular.module("myApp", []);
angular.module("myApp")
.controller("MyFavoriteCtrl", function () {
this.superspecialvar = "Hello World, 你好 土"
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment