alenaksu / mdPickers

Material Design date/time pickers for Angular Material
MIT License
296 stars 217 forks source link

After upgrade to angularjs 1.6.2 calendar does not render #191

Open pabramowitsch opened 7 years ago

pabramowitsch commented 7 years ago

On a previously working app, after upgrading angularjs, animate, aria and messages to v1.6.2 the calendar in mdpDatePicker no longer renders. The mdpPicker is located on another $mdDialog.

The popup opens with the correct date, but displays the unrendered angular reference: {{ calendar.date.format("MMMM YYYY") }}

followed by blank space

The html:

`<md-input-container class="datepickerdemoBasicUsage" flex="30">
    <mdp-date-picker mdp-format="MM/DD/YYYY" name="ep_start_date" 
         mdp-min-date='minStartDate'  mdp-max-date='maxStartDate' 
         required="" mdp-placeholder="Episode Start" ng-model="tester">
       </mdp-date-picker>
      <div class="errors" ng-messages="newCase.ep_start_date.$error" 
           ng-if="newCase.$dirty">
           <div ng-message="required">Required</div>
       <div ng-message="format">Invalid format</div>
        <div ng-message="minDate">Min date</div>
         <div ng-message="maxDate">Max date</div>
     </div>
   </md-input-container>`

I thought it might be an animation issue, so tried adding delay in the timeout function and even trying an $apply() within the callback, but no luck.

btw... with AngularJS and mdDialogs stacked up The cancel problem of a two level dialog was not solved by parenting the first dialog which used to work under Angular1.4.x, or changing skipHide: true, to multi: true, But by changing mdpPicker's cancel to call $mdDialog.hide(null), it fixed at least that problem

Any suggestions about rendering the calendar on the mdpPicker popup?

ajayreddy56 commented 7 years ago

Facing same issue Bro.After upgrading the angular. How to resolve this @pabramowitsch Please look into the issue @alenaksu

ajayreddy56 commented 7 years ago

resolve immediately @alenaksu

jazdw commented 7 years ago

@ajayreddy56 that's more than a little rude. Why don't you fix it yourself and submit a pull request.

This is caused by mdPickers using bindings in the constructor, the code should be moved to an $onInit function. In the meantime you can git mdPickers working in AngularJS 1.6.x by setting $compileProvider.preAssignBindingsEnabled(true);

jazdw commented 7 years ago

In fact there is already a PR which addresses this issue #168

dpoetzsch commented 7 years ago

I integrated angular 1.6 support in my fork https://github.com/dpoetzsch/md-pickers. See #192 for details on the fork.