question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Carbon Interactive Components not working in Angular 4 when AuthGuard is implemented

See original GitHub issue

Description

Interactive Carbon components (datatable, accordion, content-switcher, dropdown, tabs, toggles , tooltip, etc…) are not working with Angular AuthGuard module.

Detailed description

This is a bug. Our Angular4 application supports routing system(routes protection via authentication) using AuthGuard module and CanActivate Angular core features. We recently integrated authentication in our app, and it seems that the AuthGuard module prevents the (interacting) carbon components from behaving as expected. Whereas left-navigation elements expanded/collapsed, or tabs switched when a click was triggered, Since the implementation of routing using AuthGuard (see app.module.ts.14) these same component stop working.

Is this issue related to a specific component?

Yes, all component requiring Carbon JS library such as (datatable, accordion, content-switcher, dropdown, tabs, toggles , tooltip, etc…)

What browser are you working in?

  • Chrome 62.0.3202.94
  • Firefox 57.0 (64-bit)

What version of the Carbon Design System are you using? Bug reproduced using:

  • Carbon 8.1.8 (used in the sample app)
  • Carbon 7.26.10 (used in our production app)

What offering/product do you work on? Any pressing ship or release dates we should be aware of?

We are 4 sprints (2 months) in working on the V2 of our Web Portal: a system for automating the rules that govern traffic through firewalls that are managed by a service provider. We are release every sprint a new functionalities that we present to our endusers.

This bug is blocking since our interface is fully integrated with Carbon components (table pagination & sorting, left navigation expansion/collapsing, dropdown, etc…)

Steps to reproduce the issue

  1. Install sample app locally repo here
  2. Run npm install then ng serve
  3. Launch localhost:4200
  4. Using the different carbon component, try to switch tab, try to toggle accordion, etc…)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
mradulgujarcommented, Jul 27, 2018

@bdarge i came across same issue with accordion. after following akira’s response i was able to solve this. i hope this helps:

import * as CarbonComponents from ‘carbon-components’;

@Component({ selector: ‘my-component’, templateUrl: ‘./myComponent.html’, styleUrls: [‘./myComponent.css’] })

export class myComponent { private accordion: CarbonComponents.Accordion;

@ViewChild(‘root’) root: any;

ngAfterViewInit() { if (this.accordion) { this.accordion = this.accordion.release(); } this.accordion = CarbonComponents.Accordion.create(this.root.nativeElement); }

ngOnDestroy() { if (this.accordion) { this.accordion = this.accordion.release(); } }

1reaction
bdargecommented, Apr 13, 2018

Hi @dessty How did you solve it. Can you share?

Read more comments on GitHub >

github_iconTop Results From Across the Web

AuthGuard Not Working Well in Angular 4 - Stack Overflow
First, you need to login to the app before you can see the dashboard. The problem is that I can't access the dashboard...
Read more >
How to Build OAuth App with Angular 7 - Morioh
After Angular CLI finishes creating your app, cd into its directory, run ng new , and navigate to http://localhost:4200 to see what it...
Read more >
SOLVED: Interactive components not working - Bugs
I was working on the component library for my team for the past few weeks and all the interactions on the components were...
Read more >
Laracasts Forum
I am having a problem in storing and displaying articles as Jeffrey is doing in the laravel fundamentals tut . My carbon::parse is...
Read more >
CVE - Search Results - MITRE
CVE-2022-41223, The Director database component of MiVoice Connect through 19.3 ... The Upstash Redis adapter implementation did not check for both the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found