You may check this app: https://github.com/angular-app/angular-app
It is good example to start with.
Also, what might be the best way to avoid adding a script tag in my app/index.html for each new file I create?
It can be automated by grunt watcher for example. I use such a config for this task:
grunt.initConfig({
index: {
files: ['app/js/**/*.js'],
tasks: 'index:scripts'
}
})
grunt.registerMultiTask('index', 'Create index.html',
function() {
var files = grunt._watch_changed_files || grunt.file.expand(this.data);
var now = new Date().getTime();
var scripts_str = '';
var tpl = grunt.file.read('app/index.html.tmpl');
files.forEach(function(file) {
file = file.replace(/^app\//, '');
scripts_str += '<script src="' + file + '?bust=' + now + '"></script>' + "\n";
});
grunt.file.write('app/index.html', grunt.template.process(tpl, {
data: {
scripts: scripts_str
}
}))
console.log('File "index.html" created.');
});
index.html.tmpl:
<html>
<body>
...
<%=scripts%>
</body>
</html>