Category "javascript"

NestJs: Unable to read env variables in module files but able in service files?

I have an .env file at the root of my NestJs project with some env variables in it. The strange thing is that I am able to read the variables in service files

How to store data in angular [closed]

I am writing an application using angular. Once the server authentication is done I may have to store few details in the client side. e.g user

How to customize csv data in amcharts3 export function in Angular

I have 2 columns 1 with id and the other with a count. Now I want to add a column to display the percentage in the CSV and a heading for the file. data: [ { 0:

How to scratch reveal an image with Javascript canvas element

I created a canvas element where I can draw paths. There, I draw transparent paths and I "scratch" reveal the foreground. It works on both mobile and desktop.

How do I check if an array includes a value in JavaScript?

What is the most concise and efficient way to find out if a JavaScript array contains a value? This is the only way I know to do it: function contains(a, obj) {

isLucky task - CodeSignal; keeps running true even with if else statement defaulting to false

I'm doing the isLucky task on CodeSignal and my code keeps returning true. What can I do to fix this? Task: A ticket number is considered lucky if the sum of t

How to delay updating React state in react-swipeable-list?

I'm trying to use react-swipeable-list to enable swiping in a pair of lists (the first is a list of items I might shop for, the second list is the list of stuff

Updating the useState values automatically in react js?

I have a usestate array object called mo, which gets the data from an rest api from get request. I use useEffect for getting the data. const [mo, UpdateMO] = u

React Component's inline style is not working

I created Carousel component, it returns a collection of carousel boxes, before returning it I am applying style property to every returning div, but the style

Angular interceptor exclude specific urls

I am writing interceptors such that I don't have to handle the headers in every service calling my web api. The problem with this is that 99% of my calls requir

How to insert images only by url in CKEditor5 with react

I'm trying to insert images solely by url. In CKEditor 5 there is this feature but I'm not sure how can I make the img icon-button open modal to enter url. this

Showing ValueField(Id) in the next page in Extjs ComboBox Pagination

I have the ExtJs form combo which shows the values in the dropdown as checkbox and the value to select. I have used the pagination to list all the values with n

403 Error when setting application command permissions on Discord

My bot got a 403 error, even though it never happened before, and the code hasn't changed at all. throw new DiscordAPIError(data, res.status, request);

How to react to route changes on Vue 3, "script setup" composition API?

This is an example of routes I have in my application: { path: "/something", name: "SomeRoute", component: SomeComponent, meta: {showExtra: true}, }, {

How do i write a RegEx that starts reading from behind?

I have a series of words I try to capture. I have the following problem: The string ends with a fixed set of words It is not clearly defined how many words the

requireNativeComponent: "RNSScreenStackHeaderConfig" was not found in the UIManager when running android app

When running an application on android i get this error. It builds correctly but crashes with exception. I have installed React-native-screens, @React-native/na

How to use cookie inside `getServerSideProps` method in Next.js?

I have to send current language on endpoint. But getting language from Cookie returns undefined inside getServerSideProps. export async function getServerSidePr

Vuejs get index in multiple input forms

I have an array of strings like: questions: [ "Question 1?", "Question 2?", "Question 3?", "Question 4?", ], Then I have form fields in my data() like:

What's the reason the button isn't even clicking?

The button isnt working along with the dropdown option. Any changes I need to make? import React, { Component, Fragment } from 'react' export class MegaMenu ex

Not able to catch 401 status code in Angular 7 HTTP Interceptor

I am using Angular 7 and I have used HTTP Interceptor in my application. I am not able to track 401 status code in that HTTP Interceptor. I tried pitting cat