diff options
Diffstat (limited to 'docs/content/guide/dev_guide.expressions.ngdoc')
| -rw-r--r-- | docs/content/guide/dev_guide.expressions.ngdoc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/docs/content/guide/dev_guide.expressions.ngdoc b/docs/content/guide/dev_guide.expressions.ngdoc index 4df69d28..b7ecc521 100644 --- a/docs/content/guide/dev_guide.expressions.ngdoc +++ b/docs/content/guide/dev_guide.expressions.ngdoc @@ -51,14 +51,14 @@ You can try evaluating different expressions here: <doc:example> <doc:source> <script> - function Cntl2() { - this.exprs = []; - this.expr = '3*10|currency'; - this.addExp = function(expr) { + function Cntl2($scope) { + $scope.exprs = []; + $scope.expr = '3*10|currency'; + $scope.addExp = function(expr) { this.exprs.push(expr); }; - this.removeExp = function(contact) { + $scope.removeExp = function(contact) { for ( var i = 0, ii = this.exprs.length; i < ii; i++) { if (contact === this.exprs[i]) { this.exprs.splice(i, 1); @@ -101,10 +101,10 @@ the global state (a common source of subtle bugs). <doc:example> <doc:source> <script> - function Cntl1($window){ - this.name = 'World'; + function Cntl1($window, $scope){ + $scope.name = 'World'; - this.greet = function() { + $scope.greet = function() { ($window.mockWindow || $window).alert('Hello ' + this.name); } } |
