Recommended directory structure for "ANGULARJS study notes" development, basic development steps

Source: Internet
Author: User

    1. Project directory Structure Division

Debug node. JS's Build Directory

Node_modules node. js Dependencies

SRC Project Source files

----|framework Project Framework

--------|app

--------|css

--------|data

--------|font

--------|img

--------|js

--------|plugin

----|modules

--------| The module name that is filled in the parent menu, the parent node

------------|app Main project documents

----------------|app.conffee Root Module configuration js, configure the parent module, about the parent of some JS

----------------| The module name, child node, which is filled in the Sub-menu

--------------------| App.conffee submodule Configuration js, configuring sub-module

--------------------| Folders for specific pages, such as Index/add/edit

------------------------HTML for |index.tpl.html page templates

------------------------The JS required in the |index.coffee index page

------------|i18n Internationalization

    1. The app three characters means the entrance.
    2. Development steps:

A) Add the above files and folders.

b) Configure each module for angular, then configure the routing for each page, and the controller with the same name can be used under different module

c) write the controller, read the data in the controller, perform various operations, if the operation is more than can be pumped into the service, and finally assign the result of the operation to the common $scope variable

d) write the template in HTML and bind the field in the corresponding location (value in the shared object in the $scope)

e) Multi-language configuration:

f) Add a resources file, configure the namespace, and then configure the value Key:value form that requires the use of multiple languages, in Index.coffee, in. config (["$translateProvider"], ($ Translateprovider), configure the specified resource namespace, and finally use the {{key|translate}} binding when the page is used.

g) Release:

h) in the project root directory, run the command line, run grunt build–release, Generate dist directory, will all the module inside all JS are compressed into a file.

Recommended directory structure for "ANGULARJS study notes" development, basic development steps

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.