-
Notifications
You must be signed in to change notification settings - Fork 493
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ui-router update #1
Comments
When coding, it is good practice to reduce duplicating your code as much as possible. When you build a website, multiple pages may be grouped with specific layouts that are used any number of times. You don’t want to duplicate your layout code across these pages. A common thing to do in web design is to use templating. This exists similarly across many web languages, but in this example I’m going to demonstrate how to do this with AngularJS and the UI-Router extension. To be specific we are going to accomplish the following: Create a root layout that will span every page templates Index Level I added the text Index Level to make it obvious that the index.html code is used in our page. It represents level one of three in our nesting line. The ui-view line is where the next layer will display.Now let’s crack open the settings.html page. This page will pretty much just contain a menu system for navigating between settings pages. Often websites will have a separate UI system for settings pages, but yet it will keep a trend. Settings LevelShow Profile Show Account Notice the lines above. Two are responsible for loading the next level of nesting which is nesting level three. The last line is where level three will be loaded into. I threw a line of code in there to show us that the settings level was loaded. Now we are going to add the code for the third level of nesting. Open profile.html and add the following lines: Profile Level Account Level Open the app.js file and add the following code: var example = angular.module("example", ['ui.router']); .state('settings', { .state('settings.profile', { |
Hİ, thank you for your work. Could you consider to use ui-router extension for this?
The text was updated successfully, but these errors were encountered: