Closed slamborne closed 10 years ago
@slamborne why do you think you need a template folder? I hope you know that all the template files are bundled inside js files that got -tpls
in their name.
@8bitDesigner what do you mean exactly?
@pkozlowski-opensource Because i didn't look at the source code. I assumed that it worked a certain way. In my case when I was augmenting the typeahead directive in a project I was getting compile errors that showed the template path and adding the template folder worked. Oops. I suppose I'll open a pull request for the readme so no one else gets confused.
Sorry I'm late with better, non-shitty feedback. Based on the docs, I had the impression that I could simply drop in the following, and have a working tooltip:
<script src="angular/angular.js"></script>
<script src="angular-bootstrap/ui-bootstrap-tpls.js"></script>
<script src="angular-bootstrap/ui-bootstrap.js"></script>
<script>
angular.module('fs.platform', ['ui.bootstrap.tooltip'])
</script>
When, in fact, I need to pull in the individual templates as modules:
<script src="angular/angular.js"></script>
<script src="angular-bootstrap/ui-bootstrap-tpls.js"></script>
<script src="angular-bootstrap/ui-bootstrap.js"></script>
<script>
angular.module('fs.platform', [
'ui.bootstrap.tooltip',
'template/tooltip/tooltip-html-unsafe-popup.html',
'template/tooltip/tooltip-popup.html'
])
</script>
If that's really the case, a simple 5 line README would be a godsend, and if that's not expected (eg: the ui.bootstrap.tooltip
module should be including its templates as modules), then this is a bug.
@8bitDesigner no, no, you just need to include one file, and have dependency on the ui.bootstrap
module. If you don't plan on overriding templates just include ui-bootstrap-tpls.js
. I'm not sure which docs you were following but the ones on the home page and in the project README are pretty clear (or at least I was hoping so!).
Which part of the doc made you think that you need to add dependencies on individual modules (ui.bootstrap.tooltip
etc.)? Once again, I was trying to be as explicit as possible in the README:
https://github.com/angular-ui/bootstrap#installation
Could you send a pull request with proposed doc changes that would make the situation less confusing for you?
@pkozlowski-opensource Yes, the docs technically mention how things work but it's not specific or concise. You have to read a paragraph and then click a link to even touch on the subject of how the tpls files work.
I'm not trying to flame you here, but having documentation wouldn't hurt at all (I'll rework that commit).
It is not mentioned that the templates are html strings added to the templateCache, or explicitly say that the templates exist as strings of html in the tpls file. Of course it's obvious if you look at the source but come on.. The documentation doesn't mention what steps to take when you decide to use templates and how you should use the dependencies in angular. Yes, it's a simple process, but a little direction could go a long way.
Ah, @pkozlowski-opensource you're quite right; I'd glazed over the mention of adding a angular-bootstrap/ui-bootstrap-tpls.js
file, and bashed my head against things until I manually added the template modules.
:+1: to this - this project is unusable as-is.