Angular interview questions in 2024

nitish96
Nitish Sharma
Published on: October 20, 2024
Updated on: November 17, 2024
Angular interview questions in 2024 blog

1. What is Angular and how does it differ from AngularJS?

   Angular is a TypeScript-based open-source web application framework developed by Google. It's a complete rewrite of AngularJS, which was based on JavaScript. The major difference between Angular and AngularJS include

2. What is Difference between Angular and AngularJS

Category

Angular JS

Angular

Architecture

It supports the Model-View-Controller design. The view processes the information available in the model to generate output.

It uses components and directives Components are the directives with a template.

Written Language

Written in JavaScript.

Written in TypeScript language, Which is a superset of JavaScript (ECMAScript 6(ES5))

Mobile Support

It does not support mobile browsers.

Angular is supported by all the popular mobile browsers.

Dependency Injection

It does not use Dependency Injection

It is use Dependency Injection.

CLI

It does not come with a CLI tool.

It comes with the Angular CLI tool.

3. What are Single Page Applications (SPA)

    Single-page applications are web applications that load once with new features just being more additions to the user interface. It does not load new HTML pages to display the new page's content, instead generated dynamically. This is made possible through JavaScript's ability to manipulate the DOM elements on the existing page itself. A SPA approach is faster, thus proving a seamless user experience.

 4. What is decorators in Angular?

    Decorators are design pattern or functions that define how Angular features work. They are used to make prior modifications to a class, service, or filter. Angular supports four types of decorators, they are:
        a. Class Decorators
        b. Property Decorators
        c. Method Decorators
        d. Parameter Decorators

5. What are Templates in Angular?

    Angular Templates are written with HTML that contains Angular-specific elements and attributes. In combination with the model and controller's these templates are further rendered to provide a dynamic view to the user.

6. What are Angular advantages?

        a. It is relatively simple to build Single Page Applications (Components)
        b. To make flexible and structured applications  (OOPS friendly)
        c. It is Cross platform and Open Source (Free)
        d. Reusable Code(Services)
        e. Testability (spec.t)

7. What is NPM

    NPM/ Node package manager is an online repository from where you can get thousands of free libraries which can be used your angular project.

8. What is CLI Tools

    CLI is a command-line interface tool that you use to initialize and develop Angular applications.

Components & Modules

9.  What are components in Angular?

    Components are the most basic UI building block of an Angular app.

10. What is a Selector and Templates?

    A selector is used to Identify each component uniquely into the component tree.

11. What is Module in Angular? What is app.Module.ts file?

Module is a place where you can group the components directive, pipes, and services, which are related to the application.

12. How an Angular App gets Loaded and started? What are index.html, app-root, selector and main.ts?

Angular is used to create Single Page Application. Index.html file is that single page. Index.html will invoke main.js file which is the javaScript version of main.ts file.

13. What is a Bootstrapped Module & Bootstrapped Component?

    When the Angular web application will start then the first module launched is the bootstrapped module and same is true for the bootstrapped 
    component also. 

14.  What is Data Binding in Angular?

  Data binding is the way to communicate between your typescript code of your component and your html view.

15. What is string interpolation in Angular?

String interpolation is a one-way-data-binding technique that is used to transfer the data from a TypeScript code (component) to an HTML template (view).

         1. String interpolation can work on string type only not numbers or any other type.

         2. it is represented inside {{data}} double curly braces.

16. What is Property Binding in Angular?

Property binding is a superset of interpolation. It can do whatever interpolation can do. In addition, it can set an element property to a non.string data value like Boolean.

17. What is Event Binding in Angular?

Event binding is used to handle the events raised by the user actions like button click.

18. What is Two way Binding in Angular?

Tow-way data binding in Angular will help users to exchange data from the view to component and then from component to the view at the same time.

Comments

Login to leave a comment.

Build Software Application with Impact Hive