Angular Interview Questions

Angular is one of the leading Frontend framework which helps you in developing SPA single page applications. Here we have list of all the important angular interview questions which will surely help you in cracking your first job as angular developer.

The latest version of Angular is 9 and because it is using TypeScript as a primary language for development some of these questions include  TypeScript also as that can be connected topic.

If you are serious about Angular learning and willing to make career in this then some of the angular topics like Component Lifecycle, Routing, Route-guards, Change-detection, validations and version migrations will be must read from Mentor’s Tag site.

This page is only focusing on angular interview questions so If you are interested in angular learning videos or tutorials then we have a perfect place for you here.

Image result for angular logo

Please send us an email on mentorstag@gmail.com if you have some suggestions or if you want to add or modify some of angular interview questions available in this page.

  • Angular is a TypeScript-based open-source web application framework, developed and maintained by Google. It offers an easy and powerful way of building front end web-based applications.
As per official site it is one framework for both mobile and desktop. Ref Link: http://angular.io
  • TypeScript
  • DART (supported in angular 2 and 4 but nobody used it actually)
  • None of the browser supports TypeScript
  • Developers writes TypeScript code which gets compiled into ECMA Script based JavaScript Code so that it can run on web browsers.
  • TypeScript is a typed superset of JavaScript that gets compiles to plain JavaScript (as defined by http://www.typescriptlang.org )
  • Typescript follows OOP (Object Oriented Programming Concepts). Which means you can get Interface, Class, Object, Static Typed Variables, Constructors, Properties and Lambda expressions with concepts like Generics, Inheritance, abstraction and Dependency Injection.
  • Nope
  • Angular is based on Module and Component based architecture
  • Definition: Angular module is collection of multiple angular components
  • Think about this image it’s a “CUBE created by collection of smaller CUBES”. Your angular application is also very much similar to this as
  1. One angular application will have multiple modules
  2. One angular module will have multiple components
  3. Next obvious question is What is this smaller cube? (component)
  • Definition: Angular Component is combination of Template, Class and Metadata (TCM)
As per above image component is made of the following three things:
  1. Template is actually UI/View part of the component which is visible to the user of the application and its actually made of HTML and CSS elements.
  2. Class is a TypeScript class which is obviously going to have Logic in Class Methods and some kind of client-side data from variables, properties and mostly JSON collections.
  3. Metadata is actually the most confusing part for most of the developers because mostly we only know that “Metadata is data about data”.
  • Decorator is pre-defined angular function which adds metadata on angular component. All the decorators have @ prefix and when we call decorator function, we pass parameter values in it like we saw in above code
  • @Component has one parameter which is object and in it we have passed values for three properties selector, templateUrls and styleUrls
  • YES
  • Decorator term is actually derived from word “Decoration” and as same room can have multiple decorations added on that we can apply multiple decorators on single component.
  • selector property defines name of the custom tag (custom directive) by which you can load this component in HTML mark-up
  • If you check <body> tag of index.html page it has same selector in it used as a tag which actually load this component inside it at runtime.
  • This property templateUrl is useful to provide path of the HTML page which used as a template of this component.
  • This can take only one page path as value
  • This property styleUrls is useful in assigning custom css for this component and it is of array type.
  • This can take multiple css inside array brackets [] so that you can apply multiple css on one component.