Enumerate all interdependencies among 2 directories or libraries in an Angular application

I am currently working on a large Angular project and need to refactor some code by identifying dependencies between two specific folders/libs (using nx). Here is an example of the file structure:

 /apps
     /lib-1
       a.service.ts
       b.component.ts
     /lib-2
       /services
          string-util.service.ts
       /models
          custom-a.model.ts
          custom-b.model.ts
          index.ts
     /lib-3
       date-util.service.ts
       custom-c.model.Ts

In a.service.ts:

import {StringUtilService} from '../lib-2/services/string-util.service.ts';
import {CustomA, CustomB} from '../lib-2/models';
import {CustomC} from '../lib-3/custom-c.model.ts';
import {DateUtilService} from '../lib-3/date-util.service.ts';

I am looking for a way, such as a script or tool, that can provide me with the dependencies if I specify "lib-1" and "lib-2". The expected result would be:

StringUtilService,
CustomAModel,
CustomBModel,

Are there any plugins or tools in Webstorm that can help me achieve this? Or another approach could be:

If I specify "lib-2" to my tool, it should give me the following result:

"StringUtilService" used in lib-1,
"CustomAModel" used in lib-1,
"CustomBModel" used in lib-1

Answer №1

Our tool does not offer features for listing items at the type level, but within the graph visualization, you can interact with dependencies to view the specific files attributed to them. For a visual representation, refer to the following link:

https://i.sstatic.net/c5bSq.png

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Keep the list up-to-date by adding new items promptly

Utilizing Angular 7, I have implemented the following service (Click here for StackBlitz Example): @Injectable({ providedIn: 'root' }) export class TodoService { todos: BehaviorSubject<Todo[]> = new BehaviorSubject([ { id: 1, tit ...

A backend glitch is exposed by NextJS in the web application

Currently, I am utilizing Strapi for my backend and have created a small script to handle authorization for specific parts of the API. Additionally, I made a slight modification to the controller. 'use strict'; const { sanitizeEntity } = require( ...

Organizing a mat-table by date does not properly arrange the rows

My API retrieves a list of records for me. I would like to display these records sorted by date, with the latest record appearing at the top. However, the TypeScript code I have written does not seem to be ordering my rows correctly. Can anyone assist me ...

Issues arise when attempting to read data from a JSON file upon refreshing the Angular page

Currently, I am working on an Angular application where the client has requested to have the path of the backend stored in a JSON file. This will allow them to easily modify the path without requiring another deployment. I have implemented this feature su ...

Implementing a map display feature in Angular using search results

I need assistance with displaying a map in an Angular 2 application. I also want to be able to highlight specific locations or areas based on certain data points. For example: 1. Showing voting results on the map by highlighting different colored areas. ...

Do we really need Renderer2 in Angular?

Angular utilizes the Renderer2 class to manipulate our view, acting as a protective shield between Angular and the DOM, making it possible for us to modify elements without directly interacting with the DOM ourselves. ElementRef provides another way to al ...

What is the best way to transform an array of objects into a nested array through shuffling

I am dealing with a diverse array of objects, each structured in a specific way: data = [ { content: { ..., depth: 1 }, subContent: [] }, { content: { ..., depth: 2 ...

Cannot locate AngularJS + Typescript controller

I'm encountering an error while attempting to integrate TypeScript with AngularJS. The issue I'm facing is: Error: [$controller:ctrlreg] The controller named 'MyController' has not been registered Does anyone have any insights on what ...

Working with floating point numbers in Node.js with a zero decimal place

NodeJS interprets float values with a zero after the decimal point as integers, but this behavior occurs at the language level. For example: 5.0 is considered as 5 by NodeJS. In my work with APIs, it's crucial for me to be able to send float values w ...

Exploring the Power of Dynamic XML in Your Angular 4/5 Application

If example.com is an active angular 4 application with existing routes such as /product and /category, how could I create a route like /products.XML or /category.xml to display dynamic XML content for each. ...

A guide to creating a forward reference in React

I have a complex component that I need to type accurately. Here is what I am trying to achieve: interface Selector<V,T> { onChange(value:V): T } export const Selector = forwardRef<V, T>( ( { onChange }: Selector< ...

What is the best way to merge multiple *ngifs in Angular?

Hey there, I am looking to create a conditional statement with three different outputs that will be displayed in a table. Currently, this is the code snippet I have: <td><div *ngIf="todo.diffDays >90">ninety</div> </td> I want ...

Guide on displaying information on a pie chart in Angular 2 using ng2-charts

How can I display data on a pie chart like this? https://i.sstatic.net/WX9ptm.png Like shown in the image below: https://i.sstatic.net/sqlv2m.png <canvas baseChart class="pie" [data]="Data" [labels]="Labels" [colors]="Colors" [chartType]="p ...

Is it possible to specify the version of a dependency using Stackblitz?

Is it possible to specify the dependency version on StackBlitz? I recently updated the dependency on NPM, however StackBlitz seems to be stuck on installing the old version. ...

Guide on integrating a dynamic element within another element in Angular

Imagine a scenario where we have the following html structure <div [innerHTML]="contentFromAPI | safeHTML"></div> The content retrieved from the api contains multiple HTML elements, resulting in a structure like this: <div> &l ...

Dealing with Placeholder Problems in Angular 2 Material when Using setValue

Encountering an issue with Angular2's material components when a component is updated via setValue. Check out the plnkr link below for more details... [unique PLNKR link] Observed that both the value and the placeholder are occupying the same space. ...

Display the list of cities associated with the country chosen in the form

I am currently working with the repository found at https://github.com/country-regions/country-region-data/blob/master/data.js to create a mapping of countries and their related cities. I'm seeking guidance on how to achieve this task effectively. My ...

The ngOnInit function is not triggered upon instantiation of an Injectable class

What could be causing the ngOnInit() method not to be called upon resolution of an Injectable class? Code import {Injectable, OnInit} from 'angular2/core'; import { RestApiService, RestRequest } from './rest-api.service'; @Injectable ...

Discovering the import path of Node modules in ReactAlgorithm for determining the import path of

Software Development In my current project, I am utilizing Typescript along with React. To enhance the application, I integrated react-bootstrap-date-picker by executing yarn install react-bootstrap-date-picker. Unfortunately, there is no clear instruct ...

JS- Catching Errors Inside and Outside

Imagine having 2 catch blocks in your code: try { axios.get('https://example.com', {}) .then(function (responseOne: any) { return axios.post('https://example.com', {}, {}) }).then(async function (responseTwo: any) { return a ...