diff --git a/src/datepicker/datepicker.js b/src/datepicker/datepicker.js
index 0d9d078294..6766942e0c 100644
--- a/src/datepicker/datepicker.js
+++ b/src/datepicker/datepicker.js
@@ -326,12 +326,12 @@ function ($compile, $parse, $document, $position, dateFilter, datepickerPopupCon
};
// popup element used to display calendar
- var popupEl = angular.element('');
+ var popupEl = angular.element('
');
popupEl.attr({
'ng-model': 'date',
'ng-change': 'dateSelection()'
});
- var datepickerEl = popupEl.find('datepicker');
+ var datepickerEl = angular.element(popupEl.children()[0]);
if (attrs.datepickerOptions) {
datepickerEl.attr(angular.extend({}, originalScope.$eval(attrs.datepickerOptions)));
}
@@ -453,7 +453,7 @@ function ($compile, $parse, $document, $position, dateFilter, datepickerPopupCon
.directive('datepickerPopupWrap', function() {
return {
- restrict:'E',
+ restrict:'EA',
replace: true,
transclude: true,
templateUrl: 'template/datepicker/popup.html',