diff options
| author | Igor Minar | 2011-06-15 22:31:40 -0700 |
|---|---|---|
| committer | Igor Minar | 2011-06-15 22:31:40 -0700 |
| commit | b842642b574a2b95c53b791308ed1bf8ff9d304d (patch) | |
| tree | fb26431c5372be74de2105df77e94dea4f198489 /docs/content/guide/dev_guide.scopes.working_scopes.ngdoc | |
| parent | d428c9910e66246c2af46602499acaeaf187d75b (diff) | |
| download | angular.js-b842642b574a2b95c53b791308ed1bf8ff9d304d.tar.bz2 | |
docs - stripping extra new lines
Diffstat (limited to 'docs/content/guide/dev_guide.scopes.working_scopes.ngdoc')
| -rw-r--r-- | docs/content/guide/dev_guide.scopes.working_scopes.ngdoc | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/docs/content/guide/dev_guide.scopes.working_scopes.ngdoc b/docs/content/guide/dev_guide.scopes.working_scopes.ngdoc index ab507e16..8e4503a5 100644 --- a/docs/content/guide/dev_guide.scopes.working_scopes.ngdoc +++ b/docs/content/guide/dev_guide.scopes.working_scopes.ngdoc @@ -3,27 +3,22 @@ @name Developer Guide: Scopes: Working With Angular Scopes @description - When you use {@link api/angular.directive.ng:autobind ng:autobind} to bootstrap your application, angular creates the root scope automatically for you. If you need more control over the bootstrapping process, or if you need to create a root scope for a test, you can do so using the {@link api/angular.scope angular.scope()} API. - Here is a simple code snippet that demonstrates how to create a scope object, assign model properties to it, and register listeners to watch for changes to the model properties: - <pre> var scope = angular.scope(); scope.salutation = 'Hello'; scope.name = 'World'; - // Verify that greeting is undefined expect(scope.greeting).toEqual(undefined); - // Set up the watcher... scope.$watch('name', function(){ // when 'name' changes, set 'greeting'... @@ -31,35 +26,27 @@ this.greeting = this.salutation + ' ' + this.name + '!'; } ); - // verify that 'greeting' was set... expect(scope.greeting).toEqual('Hello World!'); - // 'name' changed! scope.name = 'Misko'; - // scope.$eval() will propagate the change to listeners expect(scope.greeting).toEqual('Hello World!'); - scope.$eval(); // verify that '$eval' propagated the change expect(scope.greeting).toEqual('Hello Misko!'); </pre> - ## Related Topics - * {@link dev_guide.scopes Angular Scope Objects} * {@link dev_guide.scopes.understanding_scopes Understanding Scopes} * {@link dev_guide.scopes.controlling_scopes Applying Controllers to Scopes} * {@link dev_guide.scopes.updating_scopes Updating Scopes} - ## Related API - * {@link api/angular.scope Angular Scope API} |
