jQuery error
I'm getting this error:
TypeError: undefined is not a function
if (configuration.dropdownSelector) {
jQuery(configuration.dropdownSelector).dropdown('toggle');
}
I changed it to this:
if (configuration.dropdownSelector) {
jQuery(configuration.dropdownSelector).toggleClass('open');
}
and moved the configuration.dropdownSelector - one element higher (parent element):
<div class="dropdown" id="dtdropdown">
<a class="dropdown-toggle">
<div class="input-group">
<input type="text" class="form-control" ng-model="data.myDate">
<span class="input-group-addon"><i class="glyphicon glyphicon-calendar"></i></span>
</div>
</a>
<ul class="dropdown-menu">
<datetimepicker ng-model="data.myDate" datetimepicker-config="{ dropdownSelector: '#dtdropdown' }"/>
</ul>
</div>
After looking at the code abit:
angular.element(configuration.dropdownSelector).removeClass('open');
This way jQuery is no-longer needed.
Thanks for the info. Can you please create a jsfiddle or plunker that recreates the problem?
http://plnkr.co/edit/mc4eHR1lqJDAFqF8TmY5?p=preview
(open inspect element - then set a time)
TypeError: undefined is not a function
at Object.dataFactory.setTime (http://run.plnkr.co/JpCsFqLLerb2VEn2/datetimepicker.js:307:54)
I think the issue is that I'm using angular-bootstrap (but removing jQuery-dependency seems like the right way to go):
angular.element(configuration.dropdownSelector).removeClass('open');
Fixed in 0.3.3 - See this fiddle for options when not using jQuery - http://jsfiddle.net/vj8zpmj1/2/
The problem was not using bootstrap.js - but instead using the angular version of it: http://angular-ui.github.io/bootstrap/
Ah, right, I was remembering all of the related issues - I will update the message to also look for bootstrap.js and warn accordingly.
This change is now in the develop branch if you would like to give it a try.