Link to home
Start Free TrialLog in
Avatar of axnst2
axnst2Flag for United States of America

asked on

Pull up a specific Angular page from a mobile device

HI Experts,

We're trying to evaluate whether or not Angular is a viable solution for us to use for our new web application.  As part of this evaluation process, the following questions has come up: Can a specific Angular page be called from a mobile device and pass in parameters?  Here's what I mean:  Let's say I have a mobile app that supports 50% of the functionality natively, while I want to "pass" the user over to our web application for the other 50%, i.e. Let's show the status of order X of user Y.  So we'd need to be able to authenticate user Y from the mobile app, open the Order History page of our website and display the order X of user Y.   Our current application is in MVC, where doing this is no problem.  Can this be done with a web application built in Angular 6.0 with .NET Core Web API back-end.  If yes, could someone share an example or two?

Thanks a bunch in advance!
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Can a specific Angular page be called from a mobile device and pass in parameters?
What is the relevance of a Mobile Device in this scenario?

An Angular page is just a web page - so in general yes you can call a page that is "written" in Angular and pass it a parameter - but obviously there is detail here that is important.

Our current application is in MVC, where doing this is no problem.  Can this be done with a web application built in Angular 6.0 with .NET Core Web API back-end.
If you code it to.

I am not sure I understand the problem.

What part of the process do you suspect might be an issue?

How do you do authentication? If you do it using MVC (where you state it is not a problem) how would you achieve this - maybe lets start there and see how that translates to an Angular app.
Avatar of axnst2

ASKER

So I am not saying that there's a problem.  I am just simply trying to make sure that what we need to be able to do is possible.  Want to make sure that since Angular follows a SPA design where the client is completely autonomous and disconnected from the server (so pages are not rendered on the server and delivered to the client) we'll have no issues triggering the execution of a page and can still pass in parameters to the client.  In an MVC application I can, as an example, call a URL with specific parameters in the URL, have the server look things up in the DB with respect to the values passed in, then renders the HTML based on it, then delivers it to the client to display.  How would this work in Angular?
Is there authentication and how are you planning on handling that?
Avatar of axnst2

ASKER

We're thinking using JWT, but we haven't started doing anything yet, so we can do what ever makes sense.
If your Angular app sits behind an auth-wall - how are you expecting to pass authentication through to it from the other application?

In your MVC scenario how would you do it?
Avatar of axnst2

ASKER

I don't think we're on the same page here....

1. We have nothing in place right now, so I am looking to see how we SHOULD do things not how to change how things ARE
2. There needs to be authentication of some kind to gain access to user-specific data
3.  I need to be able to authenticate the user using a mobile app then cache their credentials (username and password) locally on the device
4.  I need the user to be able to start their native mobile app (having their username and password saved on the device) then start up a browser window, go to our website (.NET Core back-end with Angular 6.0 client), authenticate using the username and password saved on the mobile device, and pull up a page specific to that user i.e. Order History

Am I making sense?
1. I know that - my question was about your intentions
2. Where?
3. Only place is cookie or localStorage and both of those are only accessible to the host / protocol / port on which they were created - if any of the aforementioned change then you cannot access that data between sessions.
4. See above.
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.