Skip to content

Instantly share code, notes, and snippets.

@jonmaim
Last active August 29, 2015 14:05
Show Gist options
  • Save jonmaim/2fd2e5e4e7fe61c031b7 to your computer and use it in GitHub Desktop.
Save jonmaim/2fd2e5e4e7fe61c031b7 to your computer and use it in GitHub Desktop.
Angular lazy one-time binding playground
<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