Created
February 19, 2013 19:18
-
-
Save fdietz/4988935 to your computer and use it in GitHub Desktop.
Recipes with Angular.js: Controllers - Assigning a Default Value to a Model
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
function MyCtrl($scope) { | |
$scope.value = "some value"; | |
} |
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
<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