sorry about my english. I use sessionstorage for keeping data. In sessionstorage have data enter image description here but in html, not showing data form sessionstorage. when I get only {{currentUser}} in html show like this enter image description here mycode services html and component how i can do to use please help me this image for {{ currentUser|json}} {{
Tag: angular
Angular: Unittest with async input pipe + mock service with HttpClient
I try to create a unittest for my angular component. The test case should do the following: Manipulate the input with “The” Check if the loading indicator is shown Return a mocked value from the service (which would normaly create a HttpRequest) Check if the loading indicator is hidden Check if the options of the response from the mocked service
Find duplicates of an array and replace it with its number
Say I have an array: arr = [25, 25, 25, 20, 15, 10, 10, 5]; and I want to count up the number of duplicates (ie. three 25s and 2 10s) and make a new array that becomes: newArr = [’25 * 3′, 20, 15, ’10 * 2′, 5]; How should I go about doing this? Thanks! Answer You can
Async elements that act as a form without a submit button
Okay, so this may seem like a lot to ask. I have been pounding my head against the desk trying to figure this out. Take the below example: I am wanting to create basically an asyncronous link between the span with the id of “Number”, and the database. Is it possible to give the user the ability to click the
How to push object to forms in angular?
How to push the roles form data value to createUserForm data value so that they will become 1 object ? #The final result should look like this This is the data from roles when I submit This is the data from createUserForm when I submit —>>> another form —>>>> User Form —>>> what i tried Answer You can achieve this
Capturing product impression without making the website slow
I am working on a website where we have thousands of products. I have to capture the impression of all products users can see in their viewport. So I created a directory and I used IntersectionObserver, and referred to it inside the HTML code of that product. The issue is that it’s causing a performing impact on the mobile site
Getting error Effect “n.loadInfo$” dispatched an invalid action
I am trying to write an effect for an action but it is throwing an error as: “Effect “n.loadInfo$” dispatched an invalid action: null Error” I have my effect as below: I have my action defined as below: And in the service as below: I have selector as below that is used in the effect: Create reducer as below after
Sort by Status then by date JavaScript
I have an array of the following type I wan to sort. I want to sort them by the status and show false ones first and and then sort them by their date. I don’t know if I should use group by then sort. I have used the below code it sorts the array by status but the date sorting
How do I trigger the (page) event on a mat-paginator only when pageIndex changes in Angular?
I’m trying to get the pageIndex every time the user goes to another page of the paginator. This code currently works, but the event also gets triggered when the pageSize changes. Answer AFAIK the event will always be triggered but you could compare the previous pageIndex to find out if it has changed.
override :host css in ionic framework
how can i override :host css } PS. this css is on ion-content I’d appreciate any help. Answer You don’t have to change the :host CSS to change the background of ion-content. You can add this to your CSS But if you really want to change :host CSS, then you can add this in your global CSS file.