Rajeun
Rajeun

Reputation: 721

include ui-bootstrap-tpls.js script

I'm trying to implement an example of iconPicker so the files which I should import are:

    <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.min.js"></script>
    <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/0.10.0/ui-bootstrap-tpls.min.js"></script>
    <script type="text/javascript" src="//rawgithub.com/justin-lau/ui-iconpicker/v0.1.4/dist/scripts/ui-iconpicker.min.js"></script>

I installed the component with bower

<script src="@routes.Assets.versioned("bower_components/angular/angular.min.js")" type="text/javascript"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/0.10.0/ui-bootstrap-tpls.min.js"></script>
<script src="@routes.Assets.versioned("bower_components/ui-iconpicker/dist/scripts/ui-iconpicker.min.js")"></script>

the problem is when I try to change the cdn link to local one I can't found this bootstrap-tpls.min.js I found it in angular-bootstrap and it didn't work for me there is any difference? enter image description here

Upvotes: 0

Views: 4681

Answers (1)

Ajay Barot
Ajay Barot

Reputation: 1680

Please Install angular bootstrap

bower install angular-bootstrap

Ref: angular ui bootstrap doc

Please see this line.

Note: do not install 'angular-ui-bootstrap'. A separate repository - bootstrap-bower - hosts the compiled javascript file and bower.json In above link.

angular-ui-bootstrap : https://github.com/angular-ui/bootstrap-bower

  • This repository contains required ui-bootstrap.js and ui-boostrap-tpls.js files. basically its bower repository to hold Angular UI Bootstrap.

  • we get this files from this command bower install ui-bootstrap

  • ui-bootstrap-tpls.js file contains ui-bootstrap.min.js + html templates.

angular-bootstrap : https://github.com/angular-ui/bootstrap.

  • This is main repository for the angular bootstrap.
  • Here you see this line in source <script src="//angular-ui.github.io/bootstrap/ui-bootstrap-tpls.js"></script> because this file contains all html + template code which used to show example of bootstrap in angular. So its reuse of ui-bootstrap-tpls.js.

I suggest please install bootstrap using bower install angular-bootstrap and remove angular-ui-bootstrap folder.

Ref: Please see this link. It shows the difference clearly. https://stackoverflow.com/a/19820670/2681997

I hope this will clear your doubt.

Thanks

Bonus: Use this to Tool for installing bower dependencies that won't include entire repos in your project.

bower installer

Upvotes: 4

Related Questions