Using AngularJS in App With Multiple Endpoints -
i learning angularjs. have basic web app has 3 screens. 3 screens are: home, product listings, , product. "home" screen basic welcome screen. "product listings" screen show list of dozens of products. each product can seen in greater detail selecting on products page. there, shown more details in "product" view. navigate around app, want use ng-view provide smooth animation between pages.
my files arranged follows:
index.html index.html.js views home.html products.html product.html when user uses app, may enter 2 different locations. may start app visiting http://www.mysite.com or http://www.mysite.com/products/{productid}. productid dynamic value. when user navigates http://www.mysite.com, know how working. however, challenge dealing scenario visits product , building other way.
does know how create angular app user may enter via either root of app or leaf node of sitemap? essentially, have site multiple endpoints. thank you!
are using $route / $routeprovider? check them out here: http://docs.angularjs.org/tutorial/step_07
i take @ yeoman build starter app you.
with yeoman can create scaffold app using best practices installing generator-angular generator yeoman - it's there on site under 'getting started'.
Comments
Post a Comment