HelloWorld
HelloWorld

Reputation: 4882

How to structure my angularjs app and test folder

In my root folder 'Client' I would like to put an 'app' and 'test' folder inside the 'Client' folder. But I have no experience wether this works fine when adding libraries/generators to each of the folders.

Should there be a problem or what is the advised way to do it right that my testing works correctly?

Upvotes: 3

Views: 2835

Answers (4)

justinwalsh
justinwalsh

Reputation: 21

These references may be useful if you are building larger apps with angular:

Upvotes: 0

Jordan Papaleo
Jordan Papaleo

Reputation: 1511

I find a good way to get started is by using npm init from your terminal. It will create your packages.json file. Ideally you would have a basic layout like this:

app
    -css
    -images
    -js
        -controllers, views, services, directives, ect
    -libs (third party libs from bower)
tests
    -e2e
    -unit
node_modules
    -modules installed by npm

I created a angular template I like to use less the test folder. you can access it here: https://github.com/breck421/angular-template. For example you would just add a test folder at the root.

Upvotes: 3

aarti
aarti

Reputation: 2865

use yeoman for scaffolding, however it requires installing both npm and yo.

http://yeoman.io/gettingstarted.html

npm install -g generator-angular

Upvotes: 2

chr1s1202
chr1s1202

Reputation: 467

There should be no problem. But here are some guidelines:

http://www.jacopretorius.net/2013/07/angularjs-best-practices.html

Yeoman angular-js generator providing a good start structure with some nice grunt tasks: https://github.com/yeoman/generator-angular

Upvotes: 0

Related Questions