Category "angular"

Angular 2 - How to upload file and store in local folder

For example, I created a folder called 'upload' under src folder. html file: <div> <input type="file" id="photo" (change)="onChange($event)" />

"Scrollable" mat dialog with component

All I found about scrolling the dialog is about the overlay, but it is to describe the behavion off the dialog, but I need to scroll the content inside of it th

How to animate :enter & :leave transitions conditionally in Angular?

I have a list, where the items have an animation like this: <li @animation> And this is my animation trigger: trigger('animation', [ transition(':en

502 Bad Gateway for Proxy Pass to HTTPS API server sitting behind Cloudflare Proxy

My current configuration is as shown below. I have frontend delivered from EC2 instance on VM1. The HTTPS API server is on VM2 proxied by Cloudfare. If I call t

How to get full base URL (including server, port and protocol) in Angular Universal?

I need to get the full base URL (e.g. http://localhost:5000 or https://productionserver.com) of my Angular 2 app so that I can pass it along to a 3rd party serv

How to get the url segment within a CanActivate guard

I am using a guard to make sure users authenticate before reaching the page they request. A particular use case foresees that a user enters a url with some que

Replace deprecated Angular ComponentFactoryResolver, ComponentFactory

I create dynamic components in an HTMLElement with the following code: import {ApplicationRef, ComponentFactory, ComponentFactoryResolver, ComponentRef, Injecto

Angular dynamic template rendering like ui grid cell template (template declared in colDefs of parent)

Angular (7) dynamic template (ng-template) rendering like ui grid cell template (template declared in colDefs of parent); I tried in so many ways since more tha

Changing tabs in Angular Material using Cypress

I have an Angular Material tab group on my page. I have to test changing of tabs using Cypress. When the page loads the user is on the Basic Information tab, I

How can Electron communicate with its Angular-Frontend?

I'm running an Angular Frontend within a frameless Electron-Window. Because the window is frameless, I need to implement the minimizing/maximizing/unmaximizing/

Spy on the result of an Observable Subscription with Jasmine

I am Jasmine unit testing an angular component, which uses Observables. My component has this lifecycle hook that I am testing: ngOnInit() { this.dataService.

Correct approach to enable or disable sidemenu on certain pages in Ionic 3?

I have gone through this SO link Ionic - How to remove sidemenu on login page only? and tried the solutions provided here. Based on the solutions provided in t

prevent click event on long press

I have the following angular2 template: <div (click)="foo()"> <img (longPress)="bar(1)" (click)="foobar(1)" /> <img (longPress)="bar(2)" (

How do you get the module of a component that's been dynamically loaded in Angular v13?

In v12 you could use the following code to load/import a component dynamically, access its NgModule through ComponentFactory and then add it to the DOM using Vi

Why does ngrx/store example app use multiple stores? (how to design store)

I am trying to make a rather big, scalable application and I was told it is best practice to have one single store storing the current global state (including b

Type 'FileOriginal' is not assignable to type 'Provider' when trying to use Native File in Ionic

I'm attempting to use PDFMaker for my Ionic 5 project. 1 prerequisite is to use the Native File and FileOpener. When I try to import the module, I get the below

Angular material slider not sliding

I am using mat-slider and, while trying to slide the control using the mouse, it does not slide, either on the left or right. It is only working when I click to

The build command requires to be run in an Angular project, but a project definition could not be found

I'm getting the following error after an npm audit fix --force (I know, I know). The build command requires to be run in an Angular project, but a project

Angular 6: simple confirmation on page leaving

I need to make a simple confirm window and I saw a lot of examples of how to do it with extra actions (like waiting until file uploading of form is not field).

ng : The term 'ng' is not recognized as the name of a cmdlet, function Visual Studio Code Terminal

In VS Code when I am running command ng build, getting error PS D:\Dashboard\Test1> ng build ng : The term 'ng' is not recognized as the name of a cmdlet, fu