I am using ExpressJs and i want to save my files outside of the project like this. im using this code for upload and its ok my files uploaded correctly but i can not show them in the app cause route will be like this http://localhost:8000/../../fileArchive/1661839542935/name.jpg nut when i set this to src of …
Tag: javascript
Angular Material Mat-error Showing error for valid inputs, while validating with regex
Creating a signup form using angular material, It is displaying errors even if there is no error. For a valid input it is displaying the error Invalid Input. I’ve removed that mat-error condition the field is turning red while entering data. The status inside the control is showing the field is valid on…
Why doesn’t the state gets updated in my sign in in and sign out functions?
Currently I have a simple React Native app which works with signing in and signing out. The only problem is that in order for the sign in to complete or for the signing out to complete (ie, take me to the other screen) I must refresh the application. I was wondering if there is something wrong in my code whic…
Why It shows Undefined when I try Access object in array in Next js
I’m trying to display sub Products of the main product so what I have tried is to get the product code from the URL and try to fetch sub-products that match the main product code the issue is it shows Undefined when I try implement like {subProducts.title} but when I console.log(subProducts) I get Array…
How to add new aggregation to xAxis by using highcharts?
I just started to use highcharts-vue. I can basically create most of the charts, but I want to add new aggregation on my column chart’s xAxis like ElasticSearch. Here is the screenshot my chart: And ElasticSearch chart: As you can see I have one data for my xAxis which is categories, but I want to add n…
How to list multi level Sub-categories under their Categories if all the catgories are in the same array of objects?
I’m working on dropdown menu of categories with sub-categories, and some sub-categories has sub-categories too. i have array of categories with parent_id property which comes from server and i want to create another array with my custom structure in client side. parent_id : null is for main category. Ca…
I defined component and used it App.js but getting undefined error
When I try to access the relevant component under app.js, I get the error “WARNING in [eslint] rcApp.js Line 2:8: ‘personAdd’ is defined but never used no-unused-vars”. When I run the project, I see tags in the form of in html, but the component does not appear on the screen. I have in…
How to prevent mui datatables render when set states in onRowSelectionChange
I’m currently working on React js project with “mui-datatables”: “^4.2.2”. I have a list of data divided on pages with the possibility of selecting an item through a checkbox : My problem : when I select an item in the second page, the component rerender and automatically back to…
How can I highlight a bar in ChartJS when selected in the legend?
I need to change background color of bar when selected it in the legend. When I updated chart with ci.update() color is reset. Answer When the chart.update() is invoked, the chart is re-configuring itself starting from chart.data.datasets and all element options (changed in the meanwhile) are lost. The chart.…
How to encode string in javaScript
I am doing an exercise, the task is: I need to write a function which takes an argument a string and returns encoded string, for example: aaabbcccc -> should return 3a2b4c. I wrote the function, I created an object where I have all characters counted but I don’t know how to return value and key conve…