angularjs - Angular UI Bootstrap - Popup Datepicker -
i have datepicker popup upon clicking button using angular ui bootstrap library's components. there examples of both on angular ui boostrap website don't see way combine them. don't idea of placing datepicker div
attribute value popup
directive's text.
i tried use ng-show
on datepicker div
can't work either.
here's code have @ moment.
<div ng-controller="datepickerctrl" class="input-append"> <input class="input-small ng-pristine ng-valid" type="text" ng-value="dt" /> <button type="button" class="btn" popover-placement="right" ng-click"showdatepicker=true" // show when clicked strategy popover="on right!"> // don't see way make encapsulate div <i class="icon-calendar"></i> </button> <datepicker ng-model="dt" ng-show="showdatepicker" starting-day="1" date-disabled="disabled(date, mode)" min="mindate" max="'2015-06-22'"> </datepicker> </div>
i don't ng-show
strategy. rather have popover assume there ways better wouldn't mind either.
update 2015-08-16 - of angular ui bootstrap 0.13.0 functionality included! works similar i've described below. use feature add popover-template="'mytemplate.html'"
element want apply popover to.
i've created new example showing feature in action.
as of 2013-07-02, there open issue angular ui bootstrap project allow put html markup inside popover.
if/when change merged, you'll able put datepicker inside template , reference template adding popover-template="mytemplate.html"
element you've declared popover on.
as example of functionality, can see plunker forked.
i update answer situation changes.
edit
if you're feeling adventurous, code used based on pull request 369, leads this commit.
there 3 reasons aware of why commit hasn't been merged yet:
- there's scope needs cleaned on when parent scope destroyed. mentioned in comment made pawel kozlowski in commit linked.
- opening, closing , reopening popover causes binding scope break when popover reopens. posted workaround in issue 220 (same issue linked above).
- there are't tests around yet.
i may try find time weekend work on these issues can merged project.
Comments
Post a Comment