ericclemmons/grunt-angular-templates — pull request #33 by mzgol (2013-07-11 17:53:03+00:00)
Title: Added onlyFilenames option

Added onlyFilenames option, writing templates under ids being only their filenames, not full paths.

My use case is as follows: my application structure has focus on componentization - files (*.js, *.scss, *.html) are grouped into directories representing single components. These directiories can be further grouped to better reflect application structure. This is only for the reader, components themselves don't depend on this structure.

I don't want to write the full path to templates in directives as it would break the assumption that components can be freely moved between directories (I have another task that adds all scrips from `components/**/*.js` as script tags in HTML so that I don't have to think about it). That's why I need an option to put templates in the `$templateCache` by their file name without the full path. Current task options don't allow such usage.

This pull request adds the `onlyFilenames` option which, when set to `true`, makes the task use filenames as IDs in the `$templateCache` service, optionally prepended by what's inside the `prepend` option. A test is included, as is a README update.