0

I have a button in the table in the first page. When I click on the button, I want to save the panel Id and display on the next page. How can I call the data in angular? I'm desperately seeking for help since I'm stuck in there for almost a week now. These are the images for my problem. enter image description here So this one is the first page, where there are buttons in each row.

After clicking Assign, it should show readonly data of ship name and panel name. enter image description here

Tinsel
  • 3
  • 3
  • 1
    Can you please your current code? Also angularjs and angular are different frameworks please tag your question accordingly. – Vimal Patel Dec 16 '20 at 04:36

2 Answers2

0

Regarding your issue, you should get the panel_id from params in the URL.

E.g. In the routing of the assigning page, you just set the path:

{
     path: 'assigning/:id',
     component: <YourComponent>
}

So you can get the panel_id by using ActivatedRoute.

Vu Phan
  • 594
  • 3
  • 8
  • this one I've already tried..but it's not working. – Tinsel Dec 16 '20 at 04:30
  • Sad, what's happened after you clicked on the Assign button? navigate to the assigning page or keep that page and change the view? – Vu Phan Dec 16 '20 at 04:41
  • If using workflow between 2 special pages, just use as my suggestion. Or you just need to resolve your code in your component when using 1 page for solving this (not related to your question). – Vu Phan Dec 16 '20 at 04:42
  • If I write this code, the assigning page doesn't show up at all.. and it's just white blank. – Tinsel Dec 17 '20 at 01:35
  • Wew, this code just an example for explaining to you. I think you should learn more and know what's you doing – Vu Phan Dec 17 '20 at 01:54
0

On click event of "Assign" button, you can pass the value to the ts component. In the ts file you can pass it via URL route as a parameter to the next page or store it in localStorage and read from the next page.

  <button (click)="passValue(value)">Assign</button>
DevBiz
  • 31
  • 4
  • can you please tell me how to store in local storage and read from next page? – Tinsel Dec 17 '20 at 01:33
  • localStorage.setItem('panelValue', ' value']);in the first page, then in the next page localStorage.getItem('panelValue'); – DevBiz Dec 17 '20 at 03:47