ANGULARJS single page routing configuration Well, it's easy to understand.

Source: Internet
Author: User

Use route to achieve single page jump function

Leveraging the ANGULARJS development process

1) Configure the ANGULARJS development environment.

2) Create a project directory with yo angular projectname

3) Delete some of the pages and scripts that the system automatically generates that are not needed by your project.

4) Modify the index.html in the

<!--ADD your site or application content here--

The above comments write their own style content, the key is

<div class= "Container-fluid" id= "main" style= "Float:left;width:calc (100%-240px);" >
<div ng-view= "" ></div>

</div>

Ng-view This div is a placeholder, using the Routing and Template feature will be inserted in this location HTML fragment of each page 5) need several pages, first use Yo angular:route routename to create a few routes, Yo will automatically generate the corresponding HTML and JS files, and then add the corresponding content in the corresponding file to
6) Pay attention to the function scope, which page's function, that is, the so-called instructions, it will be in their corresponding instruction JS file to write.

ANGULARJS single page routing configuration Well, it's easy to understand.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.