AngularJS Interview Questions

25. Explain $rootScope and how does it relate to $scope?
$rootScope is the parent object of all $scope Angular objects created in a web page.

26. What are the validations that can be implemented in AngularJS?
Data type validation
Required filed validation
Date Validation
Email Validation
Range Validation Max and Min

27. Explain how Date Validation done in Angular JS
a. Specify the type as date and
b. Format it will take as systems built-in format
c. .$error.date helps you to display the required field message.

Your Date:
<input name=”BirthDate” required=”” type=”date” placeholder=”yyyy-MM-dd” />
<span style=”color: blue;”>
Your Birth Date is required.
Oops ! Invalid Date.
</span>


28. Explain how Email Validation done in Angular JS
a. Specify the type as Email and
b. .$error.email helps you to display the required field message.

<input name=”email” required=”” type=”email” />
<span style=”color: blue;”>
Please Enter your email
Oops Invalid email address.
</span>

COPY CODE SNIPPET