Which of the following can be used as a prefix for Directive?*a) data-b) ng-c) All of the mentionedd) None of the mentioned
Question
Which of the following can be used as a prefix for Directive?*a) data-b) ng-c) All of the mentionedd) None of the mentioned
Solution
The correct answer is c) All of the mentioned.
In AngularJS, both "data-" and "ng-" can be used as prefixes for directives.
Here's a step-by-step explanation:
-
"data-" prefix: This is a HTML5 specification for custom attributes. When you use this prefix, your HTML will be valid and it will pass HTML5 validation tests.
-
"ng-" prefix: This is a default AngularJS prefix. AngularJS directives like ng-bind, ng-model, etc., all use this prefix.
So, both "data-" and "ng-" can be used as prefixes for AngularJS directives. Therefore, the answer is c) All of the mentioned.
Similar Questions
AngularJS expressions bind AngularJS data to HTML like which of the following directive?*a) ng-repeatb) ng-bindc) ng-appd) ng-model
Which module in Angular includes basic directives like @If and @For?(1 Point)AppModuleFormsModuleCommonModuleBrowserModule
Which of the following directives is used to start an angularJS application?*a) ng-repeatb) ng-initc) ng-appd) ng-model
Which of the following statement is correct about data binding in AngularJS?
what is Preprocessors and Preprocessors directives.
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.