$rootScope.Scope in AngularJS

A root scope can be retrieved using the $rootScope key from the $injector. Child scopes are created using the $new() method. (Most scopes are created automatically when compiled HTML template is executed.)

Here is a simple scope snippet to show how you can interact with the scope.

 src="./test/ng/rootScopeSpec.js" tag="docs1" />

Inheritance

A scope can inherit from a parent scope, as in thisangularjs example:

var parent = $rootScope;
var child = parent.$new();

parent.salutation = "Hello";
expect(child.salutation).toEqual('Hello');

child.salutation = "Welcome";
expect(child.salutation).toEqual('Welcome');
expect(parent.salutation).toEqual('Hello');

When interacting with Scope in tests, additional helper methods are available on the instances of Scope type. See ngMock Scope for additional details.


1 Reply

DL Deepa Loganathan Syncfusion Team September 28, 2018 06:24 PM UTC

Hi Micahwilliams,  
Thanks for the information.   
Essential JavaScript provides support for Angular Framework through wrappers. Each Syncfusion widgets are created as Angular components with built in support for data binding to make complex property definition easier. 
Please go through the below help documents to explore more about Syncfusion controls.   
Regards,   
Deepa L.  


Loader.
Up arrow icon