Skip to content

Instantly share code, notes, and snippets.

@nchaulet
Last active August 29, 2015 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nchaulet/17bcd9680cd3646b1661 to your computer and use it in GitHub Desktop.
Save nchaulet/17bcd9680cd3646b1661 to your computer and use it in GitHub Desktop.
angular-demo
<!DOCTYPE html>
<html>
<head>
<title>Demo angular</title>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.min.js"></script>
</head>
<body>
<h1>Demo angular</h1>
<script type="text/javascript">
var Scope = function() {
};
Scope.prototype.$watch = function(watcherFn, listenerFn, byValue){
};
Scope.prototype.$digest = function(){
};
Scope.prototype.$apply = function(expFn){
};
</script>
<script type="text/javascript">
var scope = new Scope();
scope.$watch(function(scope){
return scope.title;
}, function(newValue, oldValue, scope){
console.log("Le titre a changé de ",oldValue, " à ", newValue);
}, true);
scope.$apply(function(){
scope.labs.titre = "Hello world!";
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment