Skip to content
Advertisement

Tag: angular

How to pass id of object from table to next component?

In the table(table) i have loaded objects from API. When i click on “osavotjad” link i am redirected to another component where i want to load data from selected object. How can i pass id of object what is on the same line with a clicked link. Answer There are many ways to do that. The easiest solution will be

Disable Weekends on ng2-date-picker

I am looking for a function that can disable weekends on my datepicker. I know that I can use isDayDisabledCallback to disable dates but how can I only disable weekends. Answer In the configuration you can set the callback isDayDisabledCallback like that for exclude Saturday and Sunday.

Angular template interpolation

Angular version 11 I have a template which uses a method of the typescript file which returns the current date time. The thing is that if in the interpolation of the template I call this method, the first time I render the page, it works properly, but after 1 minute, the value should change to the next minute… which it

Send formArray as one object

I am using mat-stepper single form for my stepper. when i do API call it sends data as an array of objects like this: I would like to send data as one object like this: this is my form: service.ts how can i do it? Answer You can use a simple transformation using javascript reduce function to transform the data

capture error from catchError – http.post

component which is calling submitUser Here is the service file with submitUser function and here is the httpService Post and handleError methods handleError adisplays the console error, I am trying to return/capture this error in my submitUser function in service.ts How do i do that ? Any Inputs appreciated, Thanks Answer Your handleError() method returns an error observable along with

Advertisement