angular

how to initialize chart with API fetch data?

☆樱花仙子☆ 提交于 2021-02-10 07:22:55
问题 I want to use ngx-charts for my project. The problem is I don't understand how to initialize my chart with data I got from my api. The vertical bar chart seems easy. The data is of the following type: https://stackblitz.com/edit/vertical-bar-chart?embed=1&file=app/app.component.ts When I assign in the constructor Object.assign(this, data) (the data I got from my api)) I receive the following error : ERROR TypeError: Cannot read property 'toLocaleString' of undefined Their data is the

How to hide data from network tab?

家住魔仙堡 提交于 2021-02-10 07:20:07
问题 In my angular application if I go to dev tools network tab I will be able to see the response and request coming from the back end. Do anyone know how to hide or mask this data, is this possible if I do the server-side rendering? 回答1: Requests will be shown. This cannot be stopped, the application is making requests and this will be logged to the network tab by the browser, as mentioned in the comments, if there are security concenrns you should be handling this a different way. Do not send

Enable CORS in Angular 6 and ASP.net

不羁岁月 提交于 2021-02-10 07:09:37
问题 I am trying to send a POST request from my Angular 6 App to an API that sends Emails. I tested the request with postman and it worked, however when I'm doing the POST request in my Angular app I get errors in my console. My function in the Angular app: sendMail(formBody: string): any { //let url = this.config.origin + "/api/SendEmail"; let url = "http://localhost:49561/api/SendEmail"; let headers = new HttpHeaders(); headers = headers.append('Content-Type', 'application/json'); return this

Enable CORS in Angular 6 and ASP.net

本小妞迷上赌 提交于 2021-02-10 07:08:39
问题 I am trying to send a POST request from my Angular 6 App to an API that sends Emails. I tested the request with postman and it worked, however when I'm doing the POST request in my Angular app I get errors in my console. My function in the Angular app: sendMail(formBody: string): any { //let url = this.config.origin + "/api/SendEmail"; let url = "http://localhost:49561/api/SendEmail"; let headers = new HttpHeaders(); headers = headers.append('Content-Type', 'application/json'); return this

How to configure AngularFireAuthModule and/or AngularFireAuth to point to auth emulator

我是研究僧i 提交于 2021-02-10 06:49:06
问题 I believe the auth emulator was released near the end of Oct. 2020. auth emulator feature reqeust I'm trying to configure my locally served angular app to use the auth emulator by having angular/fire/auth make calls to localhost:9099. Is that possible yet? Or is the angular/fire team currently working on this? My firebase config parameter in environment is: firebase: { host: 'localhost:5000', ssl: false, apiKey: '<redacted>', authDomain: 'localhost:9099', databaseURL: '', projectId: '

Change color of selected link in angular 4 [duplicate]

血红的双手。 提交于 2021-02-10 06:47:57
问题 This question already has answers here : How to set Bootstrap navbar “active” class in Angular 2? (11 answers) Closed 2 years ago . I made a header using bootstrap 4 but I want that when I click on any link, link change its color and remains selected. <nav> <div class="collapse navbar-collapse justify-content-end" id="nav-content"> <ul class="navbar-nav" id="nav"> <li class="nav-item"> <a class="nav-link" routerLink="">About</a> </li> <li class="nav-item"> <a class="nav-link" routerLink="

Angular: refresh token only once

最后都变了- 提交于 2021-02-10 06:41:39
问题 I'm using JWT with refresh token strategy as authentication and I have an interceptor in my Angular client that sends the token as a header. I check for expiration before sending, and refresh the token with my refreshToken if needed. The problem is when sending 2 (or more) requests, both trying to refresh the token. I need a function that sends req for refresh token and when called multiple times at once, makes only 1 http req to the server for refresh and returns the new updated token to all

cannot unsubscribe ActionsSubject from ngrx/store

冷暖自知 提交于 2021-02-10 06:32:13
问题 I use ngrx/store to implement login actions which gets date from subscribe to a store. The login component is a modal, when I type a wrong password, I get data.type === 'LOGIN_FAILED' , however, when I close the modal and re-open it, the data action is still LOGIN_FAILED instead of INIT . Therefore, the login actions are not unsubscribe, I tried to manually unsubscribe the subscription, but it does not work. How can I unsubscribe the login actions properly? import { Component, OnInit,

Synchronously process an Observable dependent on another Observable using NGRX & Angular

北城以北 提交于 2021-02-10 06:31:40
问题 ngOnInit(): void { this.store.dispatch(new patients.Load([])); this.patients$ = this.store.select(fromPatients.getAll); this.patients$.map(p =>{ // patients$: Observable<Patient[]>; this.rows = p.map(pat => { //I use this on the front end return { username: pat.username, id: pat.id, hasAlert: this.hasAlerts(pat), //made this an observable for the async pipe in view settings: "Settings" }; }); this.table.recalculatePages(); console.log(this.rows); console.log("This happens first"); })

how to get the Callback from chrome.runtime.sendMessage in Angular 4?

别来无恙 提交于 2021-02-10 06:26:31
问题 I am really new working with Angular 4 and Chrome Extensions, but I have this code to comunicate my app in Angular with the Chrome extension. Code in Angular 4. public myObjectExtension : any; public getObjectChrome(){ chrome.runtime.sendMessage(extensionID, 'getObject', function(response) { console.log(response); this.myObjectExtension = reponse; }); } and I have this in my Chrome Extension. chrome.runtime.onMessageExternal.addListener( function(request, sender, sendResponse) { if(request ==