Angularjs Examples

AJS Examples


AngularJS $rootElement Service

In AngularJS, bootstrap process is started with "ng-app" directive which is root element. This root element can be declared in any DOM element such as <html>, <body> or in <div> tags to start bootstrap process. This element can be accessed using $rootElement service provided by AngularJS.

AngularJS Bootstrap process includes from AngularJS initialization to compilation process. AngularJS initialization can be done in two ways, automatic initialization and manual initialization.

Syntax

AngularJS $rootElement Service Example