angular

Getting clicked object from each section of a single stack bar as my stack bar has multiple sections Chart.js

折月煮酒 提交于 2021-02-11 14:08:39
问题 I have developed a single Stacked bar with three section or data source. I want to know which section I have clicked. This is my code .ts file this.chart = new Chart("Chart1", { type: 'bar', data: { datasets: [{ label: 'Data1', data: [27], }, { label: 'Data2', data: [40], }, { label: 'Data3', data: [12], } ], } }); showData(evt:any){ var data = this.chart.getElementsAtEvent(evt) console.log(data[0]._model); // it prints the value of the property } In the data I am not getting data object

Problem moving events in fullcalendar-angular

给你一囗甜甜゛ 提交于 2021-02-11 14:01:00
问题 I'm using Fullcalendar-Angular and I'm trying to make events move from day to another but the problem is when I start pulling some event it has to be moved to the center of the cell of the new day. I want the event to be moved once the mouse enters the cell of the new day. Here are 2 pictures of what I mean .. I'm moving the event from day 16 to day 15. Moved the event slightly before the center of the cell of day 15 -- NOT activated Moved it a little further to the left -- Activated This is

Angular custom accordion component doesn't expand on clicking

北城余情 提交于 2021-02-11 13:56:16
问题 I have created a custom accordion component in angular 9. But an issue I'm facing. Every time I click on the accordion, it only expands the first button window. Rest other windows don't expand or collapse. For a better reproduction of the issue I have attached my StackBlitz link here: https://stackblitz.com/edit/angular-x4jjxr My code: html <div *ngFor="let item of faq"> <button #el class="accordion" (click)="toggleHelper()"> <slot name="header">{{ item.question }}</slot> </button> <div class

using mqtt-ngx to connet in tls via websocket to a broker

倖福魔咒の 提交于 2021-02-11 13:51:40
问题 I have a remote mosquitto broker (on a aws ec2 instance with windows) and everything is working fine: the ports are accessible and i can publish and subscribe with the rules of my acl. I've limited the publish operation to my .net core server (with identityserver 4), while my angular8 app with ngx-mqtt subscribes. Now i'm trying to enable tls, but it keep failing on connecting. main-es2015.42b21e2ecd07be623604.js:1 WebSocket connection to 'wss://myserver/mqtt' failed: Error in connection

Angular template: use “as”-generated alias in the same instruction?

99封情书 提交于 2021-02-11 13:50:47
问题 I have an instruction like this: <ng-container *ngIf="(someService.modules$ | async | filterByPurchased:true) as purchasedModules"> some generated content <div *ngFor="let module of purchasedModules">{{module.name}}</div> </ng-container> But I also need to check if purchasedModules.length > 0 . Unfortunately, purchasedModules is not a recognized variable in the instruction where the alias is created (so I can't just add && purchasedModules.length there), why? How to do it without another <ng

Getting JSON data using JSONP from Flickr api

我与影子孤独终老i 提交于 2021-02-11 13:50:28
问题 I'm facing a new issue - Jsonp. I've read about and watched videos but couldn't get to the solution to fix my problem. First I'm using Angular 6. I'm trying to get a json response from an api which uses JSONP, but when I try to use it in my app I got CORS error. So I want to fix it without having to install chrome's CORS plugin. The response on the browser is like this: jsonFlickrFeed({ "title": "Uploads from everyone", "link": "https:\/\/www.flickr.com\/photos\/", "description": "",

Configuring angular production files after build

放肆的年华 提交于 2021-02-11 13:50:22
问题 I have an angular 9 project which is part of an application suite installer [Wix installer]. One of the settings used by the angular app is the address of API which it fetches its data from some configurable address. I know that I can have many angular environment files and simply use commands such as the followings: environment.env1.ts export const environment = { production: true, apiAddress: "http://apiAddress1/api/", }; ng build --prod --configuration=env1 or environment.env2.ts export

Is it possible in Angular reactive forms to validate on conditions out of the form?

╄→гoц情女王★ 提交于 2021-02-11 13:49:35
问题 I'm working on Angular reactive forms validation. I have an input with google autocomplete implemented on it: <input autocorrect="off" autocapitalize="off" spellcheck="off" type="text" class="input-auto input" formControlName="address"> It is standard implementation, everytime you enter some keyword, you get places suggestions: Now, what I would like to do is to validate the address. The address needs to contain zip code - only then should be valid . So once you type something and choose one

Angular material io predefined theme color

早过忘川 提交于 2021-02-11 13:46:30
问题 How do I access the color variables ( $primary, $accent, $warn, $foreground, $background) in scss file from a predefined angular theme @angular/material/prebuilt-themes/deeppurple-amber.css'? 回答1: Once a sass file has been compiled to css, there is no more notion of variable inside that css file, so you won't be able to retrieve variables like $primary from deeppurple-amber.css . If you look at the scss source file for the deeppurple-amber theme, you can find the definition for $primary and

Display given value in XY axis - Plotly

浪子不回头ぞ 提交于 2021-02-11 13:41:33
问题 I am trying to display 1,1.5,4,7,9 in X axis and 2.5,1,5,3 in Y axis. When I tried to do this, my output is like 1, 1.5, 2, 2.5,...... which is basically breakdown of values which I have given. I want only values which I have given in XY axis and I don't want auto range(Scroll value). 回答1: Assuming you are using JavaScript since you tagged angular. You are going to have to set three attributes to make this work: tickvals, ticktext, and tickmode. In the documentation you they tell you: