Skip to content

Instantly share code, notes, and snippets.

@fdietz
Created February 19, 2013 19:18
Show Gist options
  • Save fdietz/4988935 to your computer and use it in GitHub Desktop.
Save fdietz/4988935 to your computer and use it in GitHub Desktop.
Recipes with Angular.js: Controllers - Assigning a Default Value to a Model
function MyCtrl($scope) {
$scope.value = "some value";
}
<html>
<head>
<script src="js/angular.js"></script>
<script src="js/app.js"></script>
<link rel="stylesheet" href="css/bootstrap.css">
</head>
<body ng-app>
<div ng-controller="MyCtrl">
<p>{{value}}</p>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment