#AngularJS: encapsulate components and template together
AngularJS best pratices recommends to organise your code by components, however, when you need to declare template (ie. templateUrl attribute in your directive) then you are supposed to provide a path relative to your main script (usually app.js) which makes your components dependent of their positione in the file tree.
##Let's do it
Since javascript provide Document and HTMLDocument types and since document.scripts exists and do part of the job, I've decided to extend the Document prototype to provide getScriptAbsPath().
You can do it the AngularJS way by implementing a service, but to me it was more a problem at Javascript level.