Category "javascript"

Communicate two views with one controller in AngularJS

I'm using UI-Router for Angular and I have separated views for my app: sidebar and main. Now i need to change some class in main view after some action that doe

Can I set the filename of a PDF object displayed in Chrome?

In my Vue app I receive a PDF as a blob, and want to display it using the browser's PDF viewer. I convert it to a file, and generate an object url: const blob

Error when connecting Firebase to Android Studio [duplicate]

I am trying to learn how to create an Android application with Android Studio. My project is currently blank, the only page is MainActivity.ja

how do I clear a apache Echart? I need to re-initialize it

I have Stacked Horizontal Bar chart on a single page, and each chart changes based on what the user selects (Drop Down Select). I have an ajax call that retriev

getting an error while trying to run my app with firestore: Attempted to assign to readonly property

I'm currently working on an app in which you can keep track of Root Canal patients and it was working fine for a long time...but after the new update of the fir

What are asynchronous functions in JavaScript? What is "async" and "await" in JavaScript?

This Q&A is aimed to give clear answers to the following questions: What are asynchronous functions in JavaScript and when and how do we use them? What are

Testing private method using spyOn and Jest

My functions in Calculator class is private and I can't test in this way, describe('calculate', function() { it('add', function() { let result = Calculat

How to solve the smtpjs error with gmail smtp host

I am working with smptjs to send email using javascript. The code was working fine until today morning. I am getting the error "Only elasticemail is supported a

How to use componentWillMount() in React Hooks?

In the official docs of React it mentions - If you’re familiar with React class lifecycle methods, you can think of useEffect Hook as componentDid

convert Uint8Array into Uint16Array in NodeJs

I have an Uint8Array that i would like to convert into an Uint16Array so that each consecutive pair of element in the Uint8Array is converted in a Uint16 value.

React Google Identity services

I have been trying to implement Google's identity services API in my React app, but couldn't get it to work. I'm trying to implement the following really simple

ChartJS beginAtZero, min, max doesn't work

I tried every possible way, every form-answer but anything works inmy code. I want yAxes begin at zero and max value is 100 but all my chart begin with other va

ChartJS tooltip position / placement

When I hover on point of my line chart I can see tooltip. Unfortunatelly the tooltip position is left or right by default. This is how it looks now -> actual

Javascript prototype method "Cannot set property"

I'm always getting Cannot set property 'saySomething' of undefined but why? Am I making a mistake somewhere? var Person = new Object(); Person.prototype.saySo

Lazy loading translation file in <i18n> tag

I want to reduce my app size and i started from language files. I'm using vue-i18n Single File Components and i can lazy load like this vue-i18n Lazy loading. I

SheetJS xlsx-style need cell style in excel

I am trying to export excel using SheetJS/xlsx and want to format cell. I am using following code and excel is generating but can't format a cell. Can any one p

FreeCodeCamp: checking for palindromes

This is my first question, so I apologize if this isn't formatted correctly or placed in the proper area. I just completed the FreeCodeCamp checking for palind

Show/Hide menus based on User /* Flexible menu by menu */

I have React App with sidebar menus, but I want to hide few of them based on User Role, but don't want common roles like 'ADMIN' , 'MODERATOR', etc. I want to m

React-router-dom Prompt: Iframe within a page gets unloaded/loaded [closed]

I am working on a react spa to show alert on unsaved form changes. I am using [email protected] Prompt Component for this use-case. The p

Having trouble displaying values retrieved from multiple APIs to Ag-Grid rows (React)

I'm having trouble with this issue for the past couple of days and I've tried somethings but they haven't been working. I'm trying to display some stock informa