mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
fix(devtools): fix tests and leave todo related to possible typing refactor
This commit is contained in:
parent
60a4e56a95
commit
a8ba83cd30
3 changed files with 4 additions and 3 deletions
|
|
@ -83,6 +83,7 @@ const stopProfilingCallback = (messageBus: MessageBus<Events>) => () => {
|
|||
};
|
||||
|
||||
const selectedComponentCallback = (position: ElementPosition) => {
|
||||
// TODO: figure out proper typing of the node variable.
|
||||
const node = queryDirectiveForest(position, getDirectiveForest());
|
||||
setConsoleReference(node);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ export interface ComponentInstanceType {
|
|||
|
||||
export interface ComponentTreeNode extends DevToolsNode<DirectiveInstanceType, ComponentInstanceType> {
|
||||
children: ComponentTreeNode[];
|
||||
position: ElementPosition;
|
||||
position?: ElementPosition;
|
||||
}
|
||||
|
||||
export const getLatestComponentState = (query: ComponentExplorerViewQuery): DirectivesProperties | undefined => {
|
||||
|
|
|
|||
|
|
@ -23,8 +23,8 @@ const _setConsoleReference = (node: ComponentTreeNode) => {
|
|||
};
|
||||
|
||||
const prepareCurrentReferencesForInsertion = (node: ComponentTreeNode) => {
|
||||
const foundIndex = nodesForConsoleReference.findIndex(nodeToLookFor =>
|
||||
arrayEquals(nodeToLookFor.position, node.position)
|
||||
const foundIndex = nodesForConsoleReference.findIndex(
|
||||
nodeToLookFor => nodeToLookFor.position && node.position && arrayEquals(nodeToLookFor.position, node.position)
|
||||
);
|
||||
if (foundIndex !== -1) {
|
||||
nodesForConsoleReference.splice(foundIndex, 1);
|
||||
|
|
|
|||
Loading…
Reference in a new issue