From the example of UI Bootstrap of Angularjs I managed to create UI datepicker using following code.
<div class="col-md-2">
<p class="input-group">
<input type="text" class="text-box input-large input-large-altered" name="HandOverToOwner" datepicker-popup="dd.MM.yyyy" ng-model="project.dt" is-open="opened" ng-required="true" />
<span class="input-group-btn">
<button type="button" class="btn btn-default" ng-click="open($event)"><i class="glyphicon glyphicon-calendar"></i></button>
</span>
</p>
<span class="help-block" ng-show="ProjectCreate.HandOverToOwner.$error.required">Required*</span>
</div>
Now I want to get rid of calendar button and enable popup the calendar when edit box is selected. How do I replace this is-open="opened" attribute?
app.controller('createProjectController', ['$scope', function ($scope, $timeout) {
$scope.project = {};
$scope.clear = function () {
$scope.project.dt = null;
};
$scope.open = function ($event) {
$event.preventDefault();
$event.stopPropagation();
$scope.opened = true;
};
$scope.format = 'dd.MM.yy';
$scope.dateOptions = {
formatYear: 'yy',
};
}]);