0

Hello I am using UI Bootstrap for displaying datepicker in my app. this is my reference order:

  <!--ANGULAR CORE-->
<script src="//cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.18/angular.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.18/angular-route.min.js"></script>
<!--APPLICATION INIT-->
<script src="app/js/app.js"></script>
<!--JQUERY-->
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script>
<!--BOOTSRAP UI-->
<script src="app/js/libs/ui-bootstrap-tpls-0.11.0.min.js"></script>

I use the tpls version because it supposes to include the templates.

I inject the dependency like that:

 angular.module('globapp', ['ngRoute', 'ui.bootstrap'])

when I try to popup the datepicker it doesn't show. In the chrome developer I can see that the code searches for template folder, and I recieve 404 error (datepicker.html, popup.html).

I searched about that in the internet, and everyone tells the same thing: if I use the tpls version, it should provide me the default templates.

thanks

1
  • 1
    if you are using jQuery with angular, is best to load jQuery first so that angular.element (or jQlite) has access to the full jQuery library. WOuld also try loading all angular dependencies before your app.js. I've never checked if this is critical because I do it every time from habit. Also not 100% sure, but I don't think angular is fully compatible yet with jQuery 2.x
    – charlietfl
    Commented Jul 5, 2014 at 14:31

1 Answer 1

1

Your app.js has your app init -so that's where your creating your angular module and are hoping to inject bootstrap-ui as a dependency but that script hasn't been loaded yet as it's last in the list.

This would be the first thing to check. Load your scripts in order of least dependent first so jquery first then your core angular, then your plugin libraries and then your app scripts.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.