Content-Length: 291069 | pFad | http://github.com/angular/angular/pull/60694/files

60 refactor(devtools): switch to components tab whenever the inspector is used by hawkgs · Pull Request #60694 · angular/angular · GitHub
Skip to content

refactor(devtools): switch to components tab whenever the inspector is used #60694

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,13 @@ export class DevToolsTabsComponent {
this.routes.set(routes || []);
});

// Change the tab to Components, if an element is selected via the inspector.
this._messageBus.on('selectComponent', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: Just for my understanding, when is this event emitted? How does a user select a component outside of the UI? Is there an ng global API which triggers this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess my description was not very clear. Basically, when you are on a different tab from Components, using the inspector, which is available for use irrespective of the tab you're on, doesn't redirect you to the Components tab. The PR makes the behavior identical to Chrome DevTools element inspector where using the inspector from the Network tab, for example, will redirect you back to Elements.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I didn't realize the inspector button was available on different tabs, makes sense that we should switch to the Components tab when used.

(Related: Maybe it shouldn't be available on other tabs? 🤔)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's handy. Personally, I find myself occasionally using the element inspector from tabs different from Elements. Plus, it's consistent with Chrome DevTools.

if (this.activeTab() !== 'Components') {
this.changeTab('Components');
}
});

if (typeof chrome !== 'undefined' && chrome.runtime !== undefined) {
this.extensionVersion.set(chrome.runtime.getManifest().version);
}
Expand Down








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/angular/angular/pull/60694/files

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy