Wednesday, 4 September 2013

Using AngularJS in App With Multiple Endpoints

Using AngularJS in App With Multiple Endpoints

I am learning about AngularJS. I have a basic web app that has three
screens. The three screens are: Home, Product Listings, and Product. The
"Home" screen is a basic welcome screen. The "Product Listings" screen
will show a list of dozens of products. Each product can be seen in
greater detail by selecting it on the Products page. From there, they will
be shown more details in the "Product" view. As they navigate around the
app, I want to use the ng-view to provide a smooth animation between the
pages.
My files are arranged as follows:
Index.html
Index.html.js
Views
Home.html
Products.html
Product.html
When a user uses my app, they may enter it from two different locations.
They may start the app by visiting http://www.mysite.com or
http://www.mysite.com/products/{productID}. productID is a dynamic value.
When a user navigates to http://www.mysite.com, I know how to get
everything working. However, my challenge is dealing with the scenario
where someone visits a product and building everything the other way.
Does anyone know how to create an Angular app where a user may enter via
either the root of an app or the leaf node of a sitemap? Essentially, I
have a site with multiple endpoints. Thank you!

No comments:

Post a Comment