Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Put templates in a subdirectory #1205

Closed
webarnes opened this issue Oct 24, 2013 · 4 comments
Closed

Put templates in a subdirectory #1205

webarnes opened this issue Oct 24, 2013 · 4 comments

Comments

@webarnes
Copy link

This is not quite related to the asynchronous loading issue (I've seen #1188).

All the templateUrls are hard-coded to something like "template/progressbar/progress.html". This means that my template directory is filled with templates for Bootstrap components. It also means that the templateUrl template/(component) is taken for each of the components.

Unless I'm missing something, it would be friendlier to other code to put all the templates in template/bootstrap/*.

This would be a breaking change, but Bootstrap 3.0 support is going to break backwards compatibility soon anyway.

@pkozlowski-opensource
Copy link
Member

@webarnes with tricks from #1188 you can re-map paths, no?

@webarnes
Copy link
Author

From #1188, I can put the templates wherever I want. But the angular template cache will have the Angular Bootstrap template cached as template/alert/alert.html. Essentially, the problem is that this bleeds into other namespaces. What if I already have a module called alert with a template at template/alert/alert.html? What if I want to include another library that wants a template there?

@pkozlowski-opensource
Copy link
Member

@webarnes we need to put those templates somewhere in the $templateCache so there will be always risk of collisions... But adding library name is not a bad idea, I think it makes sense. Can be done as part of BS3 migration, not the top priority, though.

@joshdmiller
Copy link
Contributor

@pkozlowski-opensource I agree. Also, since we are encouraging build-time template path configuration and discouraging XHR loading of templates, perhaps we can use $templateCache a little more arbitrarily. Instead of templates/alert/alert.html we could just do angular-bootstrap-alert.tpl.html, which would be an easy transformation in grunt. Since the path in $templateCache doesn't matter and since we would be doing what we're asking users to do when they change the paths, it may make answering some of those queries easier; we would just say "take a look at our Gruntfile".

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants