I want to store some values and pass those values to an external URL. How can I achieve this?

29 views
Skip to first unread message

Raghu Ram

unread,
Aug 26, 2019, 6:00:35 AM8/26/19
to Angular and AngularJS discussion
I want to store some values and pass those values to an external URL. How can I achieve this?

Sander Elias

unread,
Aug 28, 2019, 1:01:07 AM8/28/19
to Angular and AngularJS discussion
Hi Raghu,

You mean something like this?
@Inject({
  provideIn: 'root',
})
class DemoService {
  public params = {
    endpoint: 'customers',
    page: '0',
    pageSize: 10,
  };

  public getUrl() {
    return `http://someUrl.com/${this.params.endpoint}?p=${this.params.page}&s=${this.params.pageSize}`;
  }
}

If not, can you be a bit more specific?

Raghu Ram

unread,
Aug 28, 2019, 6:59:33 AM8/28/19
to Angular and AngularJS discussion
My question is for eg.
Current domain is http://localhost:4445/#/login and after successful login I'm storing some values and redirecting to another domain http://localhost:4446/#/dashboard and I want to retrieve those stored values in the new domain http://localhost:4446/#/dashboard.
I'm using AuthGuard for dashboard.

jaint Rai

unread,
Aug 28, 2019, 7:50:48 AM8/28/19
to ang...@googlegroups.com
Hi Raghu Ram,

As per my understanding, do you want to the current login user details(name, etc..) on dashboard? or else. If yes then you can use get the Data using ActivateRouteSnapshot as below in example.
image.png

--
You received this message because you are subscribed to the Google Groups "Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/angular/1b4d6855-ecd5-4670-b80e-4dcb09e3a623%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages