I'm new to AngularJS and have gone through its tutorial, read some of its documentation, and I understand the main aspects. But I'd like some help in organizing the structure of my project.
Basically, I want to have a single page app. There will be a few main sections, e.g: Customers, Sales, Reports, etc. Each section will have its own pages e.g 'Add a Customer', 'View Sales reports', etc.
1) So, should I make one module for my app, with different routes and controllers for every screen?
2) Or should I have multiple modules, e.g one module for 'Customers', one for 'Sales', etc?
3) Say I have a 'Add Customer' form which has a bunch of fields. I want this form to be interactive e.g if the user selects his country from a dropdown, I want to load the cities for that country via an ajax request. Would I do this event handling within my controller, or should I make a directive for it? What if I'm only ever going to need this functionality for one form, should I still go to the trouble of writing a directive?
4) I want to build a CRUD form builder type of library, where I would add the fields that are required, and it would in return generate the add/edit/delete/list views and forms, alongwith the required form validation. Something like this:
var crud = new CrudLib();
crud.addTextbox('first').label('First Name').rules('required');
crud.addTextbox('email').label('Email').rules('required,email');
//....
crud.init();
Should I make this a module, or a directive, or something else?