angularjs - Why is the datepicker opening automatically? -


with below code, datepicker open , don't see input area:

html:

<td ng-controller="notificationmodalcontroller">     <span><strong>end date</strong></span>     <input type="text" name="notification.text" ng-model="notification.text" datepicker=""> </td> 

js:

app.directive('datepicker', function () { return {     require: 'ngmodel',     link: function (scope, el, attr, ngmodel) {         $(el).datepicker({             autoclose:true,             onselect: function (datetext) {                 scope.$apply(function () {                     ngmodel.$setviewvalue(datetext);                 });             }         });     } }; }); 

i'm using theme in case matters:

http://wrapbootstrap.com/preview/wb0t41tx4

why datepicker open? i'd behave 1 in theme sample closest i've gotten:

enter image description here

the bootstraper datepicker dont provide method onselect. try instead:

el.datepicker({     startdate: new date(),     format: 'dd.mm.yyyy',     autoclose: true }).on('changedate', function (e) {     somevar = e.date; }); 

Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -