Posts

Showing posts with the label angular5

Angular 5 must click to continue after HTTP Post request

Image
Clash Royale CLAN TAG #URR8PPP Angular 5 must click to continue after HTTP Post request I am working on an Angular 5 component that includes "ngx-file-drop" and "ngx-spinner" modules. The issue appears after the upload of a file via my API. The file is correctly uploaded, and on my subscribe function, it shows correctly the console.log line but not the others, so I have to click on the screen to continue. in the code below, I tried to add an eventEmitter to handle the and of the upload. It is correctly triggered but the "this.spinner.hide() and this.entryFile = null" are not executed until I click on the screen. import { Component, OnInit, EventEmitter } from '@angular/core'; import { FileSystemDirectoryEntry, UploadFile, FileSystemFileEntry, UploadEvent } from 'ngx-file-drop'; import { TranslateService } from '@ngx-translate/core'; import {NgxSpinnerService} from 'ngx-spinner'; import { HttpClient } from '@angular/commo...

reload particular component in angular when user registers using material dialog

Image
Clash Royale CLAN TAG #URR8PPP reload particular component in angular when user registers using material dialog I am trying to load the registered users in to where the registration happens on the . Once the user registers then the registered user should be populated in the .For that i have written the code as below. This below code is in projects.component.html <a href="javascript:;" (click)="openDialog()">Register</a> The below code is in projects.component.ts openDialog(): void { const dialogRef = this.dialog.open(RegisterComponent, { width:'50%', height:'85%' }); } When i click on the Register it opens up a dialog box with the below fields. The below code is register.component.html <form role="form" #heroForm="ngForm"> <!-- Registration Form on Modal Dialog Box Start --> <!-- Name Start --> <div class="form-group row"> ...

TypeScript Inheritance and Constructor Arguments

Image
Clash Royale CLAN TAG #URR8PPP TypeScript Inheritance and Constructor Arguments Using Angular 5 and TypeScript, in the following inheritance scenario, is it possible to not have to include MyService as an argument to the constructor of MyComponent ? MyService constructor MyComponent export class CBasic { // properties and methods } export class CAdvanced extends CBasic { // constructor constructor( public myService: MyService ) { // call constructor of super-class (required) super(); } // more properties and methods } export class MyComponent extends CAdvanced { // constructor constructor() { // call constructor of super-class (required) super(); // Error: [ts] Expected 1 arguments, but got 0. } } The error I am getting is [ts] Expected 1 arguments, but got 0. in MyComponent . [ts] Expected 1 arguments, but got 0. MyComponent The point is I want to include MyService in CAdvanced to avoid code-duplication i...

AG-grid VS devextreme grid

Image
Clash Royale CLAN TAG #URR8PPP AG-grid VS devextreme grid i would like to know good suggestion from you guys, which is the best one Ag-Grid vs extreme grid using in Angular 5. AG-Grid Devextreme Grid By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Angular 6 Http Interceptor only works on request with same port api request

Image
Clash Royale CLAN TAG #URR8PPP Angular 6 Http Interceptor only works on request with same port api request I am working on a SPA project with client side hosted separately with backend side. My angular project(client-side) is hosted on localhost:4200 and my web api (backend-side) is hosted on localhost:58395. I would like to create a logging/auth Interceptor through Angular 6 so I followed online tutorial and carefully tried in my own project. However, my logging interceptor or auth interceptor only will log the request with HttpClient.Get with api url in localhost:4200, although my web api request returned successfully but it's not being captured through my logging interceptor ...I am wondering if this is how interceptor works or if there is anything I did wrong on my side, if I cannot capture request to remote api I won't be able to log or attach my token... import { Injectable } from '@angular/core'; import { HttpInterceptor, HttpRequest, HttpHandler, HttpResponse }...