<!doctype html>
<html ng-app="ui.bootstrap.demo">
<head>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.4.9/angular.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.4.9/angular-animate.js"></script>
<script src="//angular-ui.github.io/bootstrap/ui-bootstrap-tpls-1.1.2.js"></script>
<script src="example.js"></script>
<link href="//netdna.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div ng-controller="DatepickerDemoCtrl">
<h4>Datepicker ng-model string value issue</h4>
Doesn't work
<div>
<input uib-datepicker-popup="{{format}}" ng-model="startDate"
is-open="dateOpened"
ng-click="dateOpened=!dateOpened"
placeholder="It Doesn't work. Just click and see the logs"
class="form-control input-sm"/>
</div>
<br/>
Works fine if Date object is passed
<div>
<input uib-datepicker-popup="{{format}}" ng-model="endDate"
is-open="dateOpened2"
ng-click="dateOpened2=!dateOpened2"
class="form-control input-sm"/>
</div>
</div>
</body>
</html>
angular.module('ui.bootstrap.demo', ['ngAnimate', 'ui.bootstrap']);
angular.module('ui.bootstrap.demo').controller('DatepickerDemoCtrl', function ($scope) {
$scope.format = 'MM-dd-yyyy';
$scope.startDate = '10-11-2015';
$scope.endDate = new Date();
});