Angular Interview Questions

What are template expressions in Angular?

Post Views: 37,875 A template expression gives a value similar to any JavaScript expression. Angular executes the expression and assigns it to a property of a binding target. The target might be an HTML element, a component, or a directive. In the property binding, a template expression appears in quotes to the right of the = symbol as in [property]=”expression”. In interpolation syntax, the template expression is surrounded by double curly braces. For example, in the below interpolation, the template…

Read More

What is interpolation in Angular?

Post Views: 37,877 Angular is a convenient alternative to property binding. It is a special syntax that Angular converts into property binding. Interpolation is represented by double curly braces ({{}}). The text between the curly braces is often the name of a component property. Angular replaces that name with the string value of the corresponding component property.

Read More

What is a service in Angular?

Post Views: 37,852 In Angular, services are used to provide a common functionality to various modules. A service provides better modularity for your app by allowing you to extract common functionality out of components. Let’s see how to create a service which can be used across multiple components. Here, service name is EgService.

Read More

What is the difference between Angular and React?

Post Views: 37,843 Angular and React both are related to JavaScript but there are a lot of differences between them. See the main differences between Angular and React: Angular is a JavaScript framework while React is a JavaScript library. Angular is written in TypeScript while React is written in JavaScript. Angular is developed and maintained by Google while React is developed and maintained by Facebook. The first version of Angular was AngularJS and released in 2010 while the first version…

Read More

What is compilation in Angular? What types of compilations are used in Angular?

Post Views: 37,839 The Angular applications are written in TypeScript and HTML. Their components and templates must be converted to executable JavaScript by the Angular compiler. There are two types of compilations in Angular: Just-in-time (JIT) compilation: This is a standard development approach which compiles our Typescript and html files in the browser at runtime, as the application loads. It is great but has disadvantages. Views take longer to render because of the in-browser compilation step. App size increases as…

Read More