Skip to content
Advertisement

Tag: angular

Angular – No provider for FormBuilder

I am using Angular 9. I am getting the following error: No provider for FormBuilder It has been reported in many cases, and the general solution appears to be to add the FormsModule to the app.module.ts file. e.g. I have tried this, but am still getting the error. Question Am I maybe doing something that’s changed in Angular 9? What

Angular: Date Timezone Global parameter setting

I am searching for a way to Convert all-new Dates upon construction/declaration to Pacific Standard time. (Without every developer in team manually setting the timezone) Additionally, dates displayed should be showed in Pacific Timezone when displaying in HTML, console.log, etc How can this be done? Is there a global parameter in Angular to set this, maybe in the config files?

How to remove # from URL and 404 reload issue in angular build and nodejs application?

I have Angular9 and nodejs application. I am doing ng build –prod for production build and putting that build file inside nodejs public folder and now i am able to access the page perfectly. but my problem is in URL i want to remove #. Currentlly i am getting as http://localhost:8080/#/about http://localhost:8080/#/admin/create/blog I user some technique to over come this

Catch the click event on class inside SVG in Angular

In my Angular 9 app I need to add the svg file as an interactive image. The svg itself is in my-file.svg and looks like this: I have a component: And in the car-view.component.html I include this svg as: How can I call the elementClicked() function inside CarViewComponent on click event on my-polygon-class (which is inside the svg)? I also

Angular Validator check if input is number

I’m trying to perfom form validation in Angular 9 to check if the value of a certain input is a number (integer or decimal). I therefore created the following custom validator: It works fine for an integer or decimal input, telling my that it’s valid, however it also tells me that the following string value for example “foo” is valid.

How to get a Waveform Music Player with Angular/Typescript

My goal is to set up a simple music player in my angular 8 project, that displays the inserted music in static wave form, similar to soundclouds player: According to my search, this can be done with either: Peaks JS: https://medium.com/better-programming/peaks-js-interact-with-audio-waveforms-b7cb5bd3939a Amplitude JS : https://521dimensions.com/open-source/amplitudejs/docs/configuration/ or Wavesurfer JS: https://wavesurfer-js.org/ Unfortunately, none of them has a decent documentation on how to

Can’t do a default import in Angular 9

I changed tsconfig.json by adding this properties “esModuleInterop”: true, “allowSyntheticDefaultImports”: true, in order to be able to import a npm package import * as ms from “ms”; But I still get this error What am I missing? Update: If I change with import ms from “ms”, then it works fine with the compiler but not with VSCode linter and the

ng-select : add an extra option

How can I add an extra item to my ng-select dropdown like the Create New in the following image : This is the current code I have: I tried using <ng-option> but the item didn’t appear in the dropdown. How can I add an extra item form the template? Answer You can use [addTag] and addTagText. [addTag] : Allows to

2 select filters on Array Values in object

I have the below data object: And a html page with 2 select boxes. In my ts file I would like to filter the tags array for selectedTag1, selectedTag2 or Both. i am not sure how to filter the array (do I need to loop through it?) AND I do not know how to combine the 2 filters (do I

Advertisement