Skip to content

Instantly share code, notes, and snippets.

@jbruni
Created April 10, 2014 04:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jbruni/10342051 to your computer and use it in GitHub Desktop.
Save jbruni/10342051 to your computer and use it in GitHub Desktop.
A Pen by J Bruni.
<div class="main" ng-app="codepen" ng-controller="codepenCtrl">
<p class="form-group">
<input class="form-control" type="text" value="{{ date | date:'fullDate' }}" readonly>
</p>
<p class="form-group">
<input class="form-control" type="text" ng-model="text">
</p>
<p>
<button popover-placement="bottom" popover-template="calendar.html" class="btn btn-default">Date Picker</button>
</p>
<script id="calendar.html" type="text/ng-template">
<div ng-model="date">
<datepicker show-weeks="false"></datepicker>
</div>
<hr />
<div class="alert alert-success">{{ text }}</div>
</script>
</div>
angular.module('codepen', ['ui.bootstrap']);
var codepenCtrl = function ($scope) {
$scope.date = new Date();
$scope.text = 'Click a date to check the binding.';
};
div.main {
padding: 2em;
text-align: center;
width: 50%;
margin: auto;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment