-
Answer :
There are four types of NgModules –
- Features Module
- Routing Module
- Service Module
- Widget Module
- Shared Module
-
Answer :
A cookie is a small piece of data sent from a website and stored on the user's machine by the user's web browsers while the user is browsing.
-
Answer :
Angular executes a pure pipe only when it detects a pure change to the input value. A pure change can be primitive or non-primitive.
Primitive data are only single values, they have not special capabilities and the non-primitive data types are used to store the group of values.
@Pipe({
name: 'currency'
})
-
Answer :
Angular executes an impure pipe during every component change detection cycle. An impure pipe is called often, as often as every keystroke or mouse-move.
If you want to make a pipe impure that time you will allow the setting pure flag to false.
@Pipe({
name: 'currency',
pure:false
})
-
Answer :
A pipe can accept any number of optional parameters to achieve output. The parameter value can be any valid template expressions. To add optional parameters follow the pipe name with a colon (:). Its looks like- currency: 'INR'
In the following example –
<h2>The birthday is - {{ birthday | date:"MM/dd/yy" }} </h2>
<!-- Output - The birthday is - 10/03/1984 -->
-
Answer :
The chaining Pipe is used to perform the multiple operations within the single expression. This chaining operation will be chained using the pipe (I).
In the following example, to display the birthday in the upper case- will need to use the inbuilt date-pipe and upper-case-pipe.
In the following example –
{{ birthday | date | uppercase}}
-
Answer :
BrowserModule – The browser module is imported from @angular/platform-browser and it is used when you want to run your application in a browser.
CommonModule – The common module is imported from @angular/common and it is used when you want to use directives - NgIf, NgFor and so on.
FormsModule – The forms module is imported from @angular/forms and it is used when you build template driven forms.
RouterModule – The router module is imported from @angular/router and is used for routing RouterLink, forRoot, and forChild.
HttpClientModule –The HttpClientModule is imported from @angular/common/http and it used to initiate HTTP request and responses in angular apps. The HttpClient is more modern and easy to use the alternative of HTTP.
No comments:
Post a Comment