1. Question:What is Controller in AngularJS? 

    Answer
    The controller defines the actual behavior of your app. It contains business logic for the view and connects the model to view with the help of $scope. A controller is associated with a HTML element with the ng-controller directive.






    1. Report
  2. Question:What is View in AngularJS? 

    Answer
    The view is responsible for presenting your models data to end user. Typically it is the HTML markup which exists after AngularJS has parsed and compiled the HTML to include rendered markup and bindings.






    1. Report
  3. Question:How to apply validation in AngularJS? 

    Answer
    AngularJS provides you built-in validation directives to validate form client side. This makes your life pretty easy to handle client-side form validations without adding a lot of extra effort. AngularJS form validations are based on the HTML5 form validators.
    
    AngularJS directives for form validation
    Here is a list of AngularJS directive which can be applied on an input field to validate its value.
    <input type="text"
       ng-model="{ string }"
       [name="{ string }"] 
       [ng-required="{ boolean }"] 
       [ng-minlength="{ number }"] 
       [ng-maxlength="{ number }"] 
       [ng-pattern="{ string }"] 
       [ng-change="{ string }"]> 
    </input>






    1. Report
  4. Question:What is Service in AngularJS? 

    Answer
    A service is a reusable singleton object which is used to organize and share code across your app. A service can be injected into controllers, filters, directives.
    
    AngularJS offers several built-in services (like $http, $provide, $resource, $window, $parse) which always start with $ sign.






    1. Report
  5. Question:What are different ways to create service in AngularJS? 

    Answer
    There are five ways to create a service as given below:
    1. Service
    2. Factory
    3. Provider
    4. Value
    5. Constant






    1. Report
Copyright © 2025. Powered by Intellect Software Ltd