Answer: b. ng-app
Explanation: ng-app directive initializes an AngularJS application
Answer: c. All of the above
Explanation: The ng-init directive initializes an AngularJS application data. This directive is used to put values to the variables to be used in the application. The ng-init directive evaluates the given expression(s) and can add some unnecessary logic into the scope.
Answer: c. All of the above
Explanation: AngularJS initializes automatically upon DOMContentLoaded event or when the angular.js script is evaluated if at that time document.readyState is set to 'complete'. At this point AngularJS looks for the ngApp directive which designates your application root. If the ngApp directive is found then AngularJS will:
- load the module associated with the directive.
- create the application injector
- compile the DOM treating the ngApp directive as the root of the compilation.
Answer: b. No
Explanation: No, an HTML page cannot have multiple "ng-app" directive for bootstrapping multiple AngularJS application. The ng-app directive is used to auto-bootstrap an AngularJS application. And according to AngularJS Documentation, only one AngularJS application can be auto-bootstrapped per HTML document. The first ngApp found in the document will be used to define the root element to auto-bootstrap as an application. To run multiple applications in an HTML document you must manually bootstrap them using angular.bootstrap instead. AngularJS applications cannot be nested within each other.
Answer: c. No, only one app is automatically initialized. Others have to be manually initialized.
Explanation: Only one app is automatically initialized. To run multiple applications in an HTML document, one must manually bootstrap them using angular bootstrap service.
Answer: c. 'ng-', 'data-ng-', 'ng:', 'x-ng-'
Explanation: AngularJS directives are extended HTML attributes with the prefixes such as 'ng-', 'data-ng-', 'ng:', 'x-ng-'