Angularjs+requirejs project directory Structure idea

Source: Internet
Author: User

Preparing to use Angularjs + Require.js as the underlying framework for a new project, the following catalog results are just a preliminary idea:

/default put the page, but for one page project , it may need to build a partials folder;

/develop test and Web server related things, this is not required to deploy to the formal environment, so isolated from the static

/static Css+img+js+partials+r.js+build.js, the back two is require.js packed compression merge deployment needs to use,

The css+img+js+partials has the following common structure, which is intended to be divided into functions:

/app specific business-related code

/modules Public UI Components

More JS.

/lib Angularjs,require.js,jquery.js, etc. third-provided libraries

Configuration of the Config.js require.js

/build Require.js executes r.js scripts that are generated after the merge of code compression, only the/build and/default folders are deployed to the formal environment.

This is just a simple assumption, depending on the directory structure of the Angular-seed project, each module will contain the following directories

For more complex business module, this can be the following structure:

The above is complete.

The first attempt to use the angular.js, may think relatively simple, only in the actual process of slowly optimizing.

Seek the guidance of the great God passing by!

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.