Home uib-datepicker-popup causing keypress in input to be undefined in angular 1.6
Reply: 0

uib-datepicker-popup causing keypress in input to be undefined in angular 1.6

bschmitty
1#
bschmitty Published in 2018-02-13 20:13:13Z

I recently updated my Angular app from Angular 1.5 to Angular 1.6.6. I am using Angular-Bootstrap version 1.3.2. Here is my html:

<div class="input-group">
<input
        type="text"
        class="form-control"
        placeholder="{{calendarCtrl.placeholder}}"
        datepicker-append-to-body="calendarCtrl.appendToBody"
        uib-datepicker-popup="{{calendarCtrl.dateFormat}}"
        datepicker-options="calendarCtrl.dateOptions"
        ng-model="calendarCtrl.innerModel"
        is-open="calendarCtrl.isOpen"
        ng-blur="calendarCtrl.dateChanged()"
        ng-keyup="calendarCtrl.updateInnerModel(calendarCtrl.innerModel)"
        />
<span class="input-group-btn">
    <button class="btn btn-default" type="button" ng-click="calendarCtrl.open()">
        <i class="fa fa-calendar"></i>
    </button>
</span>

With my recent Angular version upgrade, everytime I type into the input the binding from the template to my controller is undefined.

public updateInnerModel (text) {
     console.log(text) // undefined
}

If I remove this line:

uib-datepicker-popup="{{calendarCtrl.dateFormat}}"

everything works great.

Has anybody experienced this issue or know why it would be causing the binding to be lost? I realize Angular-Material is no longer being maintained but this is an older project and I'd like to stick with it for now if there is an option to make this work.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.297528 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO