angular-ui / bootstrap

PLEASE READ THE PROJECT STATUS BELOW. Native AngularJS (Angular) directives for Bootstrap. Smaller footprint (20kB gzipped), no 3rd party JS dependencies (jQuery, bootstrap JS) required. Please read the README.md file before submitting an issue!
http://angular-ui.github.io/bootstrap/
MIT License
14.27k stars 6.73k forks source link

Error appears when using 'minMode' together with 'maxDate' or 'minDate' #6284

Closed chrislandeza closed 8 years ago

chrislandeza commented 8 years ago

This screenshot shows the error on the console after I clicked the datepicker http://i.imgur.com/RnxTQmG.png

Error: [$compile:nonassign] Expression '{'minMode': 'month', 'maxDate': filters.month_to}' used with directive 'uibDatepickerPopup' is non-assignable!

Basically, I'm trying to create a "Month Range Picker" for my app so I used the combination of minMode and minDate/maxDate

here's the sample html markup:


<!-- Month From -->
<input type="text"
class="form-control" 
datepicker-options="{'minMode': 'month', 'maxDate': filters.month_to}"
ng-model="filters.month_from"
uib-datepicker-popup="MMM-yyyy"
show-button-bar="false"
readonly
is-open="monthFromDP"
placeholder="MM-YYYY"/>

<!-- Month To-->
<input type="text"
class="form-control" 
datepicker-options="{'minMode': 'month', 'maxDate': filters.month_from}"
ng-model="filters.month_to"
uib-datepicker-popup="MMM-yyyy"
show-button-bar="false"
readonly
is-open="monthToDP"
placeholder="MM-YYYY"/>

Here's a plunk to reproduce what I'm saying: http://plnkr.co/edit/cXEWPIknF4SjNzdbEJUY?p=preview

If I remove the minMode option, the error goes away.

` I'm using AngularJS v1.5.8 ui-bootstrap-tpls-2.0.2.js

chrislandeza commented 8 years ago

Fixed by this thread: https://github.com/angular-ui/bootstrap/issues/5948

Closing this issue.