Angular 8 Interview Questions – Javatpoint

1 What are Pipes in Angular?Â

Pipes are simple functions designed to accept an input value, process, and return as an output, a transformed value in a more technical understanding. Angular supports several built-in pipes. However, you can also create custom pipes that cater to your needs.Â

Some key features include:Â

  • Pipes are defined using the pipe “|” symbol.Â
  • Pipes can be chained with other pipes.
  • Pipes can be provided with arguments by using the colon (:) sign.
  • 3 How are Angular expressions different from JavaScript expressions?

    One major difference between Angular expressions and JavaScript expressions is that Angular expressions are compiled while JavaScript expressions are not. This means that Angular expressions are more efficient since theyre already pre-processed. Additionally, Angular expressions can access scope properties while JavaScript expressions cannot. Finally, Angular expressions support some additional features such as filters and directives which arent available in JavaScript expressions.

    Javascript expression example:

    Â Â Â Â Â Â

    Â Â Â Â Â Â

    Â Â Â Â Â Â Â Â Â Â

    Â Â Â Â Â Â Â Â Â Â

    Â Â Â Â Â Â Â Â Â Â JavaScript Test

    Â Â Â Â Â Â

    Â Â Â Â Â Â

    Â Â Â Â Â Â Â Â Â Â

    Â Â Â Â Â Â

    Â Â Â Â Â Â

    Â Â Â Â Â Â Â Â Â Â use strict;

    Â Â Â Â Â Â Â Â Â Â let bar = {};

    Â Â Â Â Â Â Â Â Â Â document.getElementById(foo).innerHTML = bar.x;

    Â Â Â Â Â Â

    Â Â Â Â Â Â

    Angular expression example:

    import { Component, OnInit } from @angular/core;

    Â Â Â Â Â Â @Component({

    Â Â Â Â Â Â Â Â selector: app-new,

    Â Â Â Â Â Â Â Â template: `

    Â Â Â Â Â Â Â Â Â Â Â Â

    {{message}}

    Â Â Â Â Â Â Â Â `,

    Â Â Â Â Â Â Â Â styleUrls: [./new.component.css]

    Â Â Â Â Â Â })

    Â Â Â Â Â Â export class NewComponent implements OnInit {

    Â Â Â Â Â Â Â Â message:object = {};

    Â Â Â Â Â Â Â Â constructor() { }

    Â Â Â Â Â Â Â Â ngOnInit() {

    Â Â Â Â Â Â Â Â }

    Â Â Â Â Â Â }

    What are the new updates with Angular10?Â

  • Older versions of TypeScript not supported – Previous versions of Angular supported typescript 3.6, 3.7, and even 3.8. But with Angular 10, TypeScript bumped to TypeScript 3.9.
  • Warnings about CommonJS imports – Logging of unknown property bindings or element names in templates is increased to the “error” level, which was previously a “warning” before.
  • Optional strict setting – Version 10 offers a stricter project setup when you create a new workspace with ng new command.
  • NGCC Feature – Addition of NGCC features with a program based entry point finder.Â

  • Updated URL routing
  • Deprecated APIs – Angular 10 has several deprecated APIs.
  • Bug fixes – With this Angular 10 version, there have been a number of bug fixes, important ones being the compiler avoiding undefined expressions and the core avoiding a migration error when a nonexistent symbol is imported.
  • New Default Browser Configuration – Browser configuration for new projects has been upgraded to outdo older and less used browsers.Â
  • Angular Interview Questions And Answers | Angular 8 Interview Questions And Answers | Simplilearn

    Related Posts

    Leave a Reply

    Your email address will not be published. Required fields are marked *