Category "angular"

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

material angular select all checkbox

I'm trying to implement select all checkbox on angular material. When user click on specifc checkbox (item), master checkbox should show Indeterminate and turn

Is it possible to create tables within Angular ts files?

So I have an array which holds different categories to compare different companies. Depending on the user selection there may be 3 categories or 10 to display.

Angular2 Typescript Customized Alert

I am totally new to Angular2, And I am stuck on how to create an customized alert like this: check this alert box here Since I am new to Angular2 concepts , I

RxJS: takeUntil() Angular component's ngOnDestroy()

tl;dr: Basically I want to marry Angular's ngOnDestroy with the Rxjs takeUntil() operator. -- is that possible? I have an Angular component that opens several

Angular - An unhandled exception occurred: spawn UNKNOWN

In Angular-13 project I have a project that has been working very fine. But suddenly, when I did ng serve I got this error: An unhandled exception occurred: spa

How can i set a default selection in PrimeNG Treetable

I want to set the selection with the value i get from Local-Storage. Here is the code: HTML: <p-treeTable [value]="tableDataRow$ | async" [col

popup is not showing on button click

I'm using devextreme components in my angular web app. Now, I'm trying to show a popup, if the user clicks on a toolbar button. I bind the popup visibility to a

How to test Custom Elements / Web Components with Testing-Library, Jest and JSDOM?

I am trying to test an Angular app with testing-library/angular@11 and [email protected] which uses custom-elements quite heavily. Unfortunately I am not quite sure i

Angular: ERROR Error: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked

What's wrong? Getting the following error in console: AboutComponent.html:1 ERROR Error: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed a

Responsive Typography in Angular Material

Trying to figure out how to set font size of mat-tab-label based on screen size (below 400px). I tried putting custom configs in different media queries like t