Last active
August 29, 2015 14:05
-
-
Save jonmaim/2fd2e5e4e7fe61c031b7 to your computer and use it in GitHub Desktop.
Angular lazy one-time binding playground
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> | |
</head> | |
<script src="http://code.angularjs.org/1.3.0-beta.18/angular.js"></script> | |
<script> | |
var myApp = angular.module('myApp',[]); | |
myApp.controller('MyCtrl', function MyCtrl($scope) { | |
$scope.name = 'Superhero'; | |
setTimeout(function() { | |
console.log('!!!'); | |
$scope.name = 'Peter Quill'; | |
$scope.$digest(); | |
}, 3000) | |
}); | |
</script> | |
<body ng-app="myApp"> | |
<div ng-controller="MyCtrl"> | |
Hello {{::name}} | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment