Array values not correct when pushing in typescript

I am trying to fill an array in typescript, the key part of this is that each object pushed to the array has a different date. I have tried logging the dates and they are printing correctly, but at the end of the method after the loop, I log the array and every object has […]

By Trey Aesthetics
Categorized as angular, arrays, for-loop, loops, typescript Tagged , , , ,

How to parse data from component into Guard in Angular

I want to show a prompt on screen to the user if they are trying to navigate away from a page in which they have made changes to a form. I have created a Guard so far, and successfully got it to log something in the console when the user navigates away from this page. […]

Stop object/variable changing with subscribe in typescript

I am trying to implement some form validation to my project, of which change detection is a part, whereby if the user is "editing" and they try to navigate away, I want to show a prompt if they have unsaved changes. An issue I am facing is I have an Array that contains data from […]

How to force reload and clear cache in Typescript?

it recently came to my attention that simply using window.location.reload() is not a hard refresh i.e. cache is cleared along with the refresh. I was then told to use window.location.reload(true) but I discovered this has since been deprecated. I am not sure how to determine whether or not the cache has been cleared, so I […]

By Trey Aesthetics
Categorized as angular, caching, refresh, reload, typescript Tagged , , , ,

How to create a Validator.pattern that accepts ONLY numbers

I am working on an angular project, and I am trying to ensure that an input field only accepts positive integers between 1 and 28, however the regex I have tried is not marking the form field as invalid when letters are entered. Here is my code: setDateRegex = /^[0-9]*$/; . . . scheduleSetDaysBefore: [null, […]

Still Have Questions?

Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us