Search results for "angular"


Answer for routerLinkActive always set home page link as active even if other page is active – Angular 10

on October 4, 2020 πŸ”₯ 0 views

I believe you need to use [routerLinkActiveOptions] in your template page. [routerLinkActiveOptions]=”{exact:true}” Set the above [routerLinkActiveOptions] directive to all navigation links, which will add the routerLinkActive class to only those navigation links which match the entire URL.

discussion

routerLinkActive always set home page link as active even if other page is active – Angular 10

on October 2, 2020 πŸ”₯ 0 views

I am using the angular 10 version I have an issue withΒ the routerLinkActive it is setting the home URL (base URL) to active even if the route is on another page. <li class=”nav-item”> <a class=”nav-link” [routerLink]='[“”]’ routerLinkActive=’active’>Home</a> </li> <li class=”nav-item”> <a class=”nav-link” [routerLink]='[“/contact-us”]’ routerLinkActive=’active’>Contact Us</a> </li>

discussion

Answer for Difference between an Annotation and a Decorator in Angular?

on October 1, 2020 πŸ”₯ 0 views

Annotations In Angular, annotations are used for creating an annotation array. They are only metadata sets of the class using the Reflect Metadata library. Decorators In Angular Decorators are design patterns used for separating decoration or modification of some class without changing the source code.

discussion

Answer for What is ViewEncapsulation and how to do it in Angular?

on October 1, 2020 πŸ”₯ 0 views

ViewEncapsulation determines whether the styles defined in a particular component will affect the entire application or not. Angular supports 3 types of ViewEncapsulation: 1) Emulated – Styles used in other HTML spread to the component 2) Native – Styles used in other HTML doesn’t spread to the component 3) None – Styles defined in a […]

discussion

Answer for How To Call Multiple Rest API and Subscribe in Angular 10?

on September 30, 2020 πŸ”₯ 0 views

To call multiple API parallelly and get a combined response in one short we can use forkJoin method of rxjs. You can do something like this as shown below, forkJoin([ getCurrentUser(), //observable 1 getDeviceConditions() //observable 2 ]).subscribe(([users, deviceConditions]) => { // When Both are done loading do something });

discussion

How To Call Multiple Rest API and Subscribe in Angular 10?

on September 30, 2020 πŸ”₯ 0 views

I have multiple methods that contain individual get method but in component How to Call Multiple Rest API and Subscribe in component i.e. calling multiple methods in one subscribe. /** * Get current User from the server. * * @returns {json} current user. */ public getCurrentUser(): any { return this.http.get(this.baseUrl) .pipe(map((res: any) => res.data)); } […]

discussion

Answer for What is the difference between pure and impure pipe in angular?

on September 30, 2020 πŸ”₯ 0 views

(a, b) => a + b; is pure a => a + 2; is pure a => b => a + b; is pure a => a + b; is impure as it uses an external value (b) (a, b) => c = a + b; is also impure as it has a side effect […]

discussion

What is ViewEncapsulation and how to do it in Angular?

on September 30, 2020 πŸ”₯ 0 views

Can anyone explain how to use ViewEncapsulation in angular with example?

discussion

Difference between an Annotation and a Decorator in Angular?

on September 30, 2020 πŸ”₯ 0 views

Can anyone please explain the difference between an Annotation and a Decorator in Angular with example?

discussion

Answer for What is the difference between pure and impure pipe in angular?

on September 30, 2020 πŸ”₯ 0 views

Pure Pipe A pure pipe is only called when Angular detects a change in the value or the parameters passed to a pipe @Pipe({ name: ‘filterPipe’, pure: true })export class FilterPipe {} Impure Pipe An impure pipe is called for every change detection cycle no matter whether the value or parameter(s) changes. An impure pipe […]

discussion