Angular Material Date Picker With Blank Calendar

I am having problems using the date picker in the angular material version 1.1.1, if I switch to angular material 1.1.0, the calendar works when I put on the code: http://codepen.io/lhrossi/pen/eBQLoy

here is my HTML:

<md-content md-theme="infocargas" layout-padding>
    <form name="newDeliveryForm">
        <div layout-gt-xs="row">
            <md-input-container class="md-block" flex-gt-xs>
                <label>Operador Logístico (Bloqueado)</label>
                <input ng-model="company" disabled /> 
            </md-input-container>
        </div>

        <div layout-gt-sm="row">

            <md-input-container flex-gt-sm>
                <label>Digite CTe</label>
                <input ng-model="delivery.cte" />
            </md-input-container>

        </div>

        <div layout-gt-sm="row">

            <md-input-container flex-gt-sm>
                <label>Entrega Para</label>
                <!--<md-datepicker ng-model="myDate"></md-datepicker>-->
                <md-datepicker ng-model="myDate" md-placeholder="Enter date"></md-datepicker>

            </md-input-container>

        </div>
        <md-button class="md-raised md-primary">Gerar Código</md-button>

    </form>

</md-content>

Is this a mistake, or are there other thoughts? I'm afraid to change the version of the material so as not to confuse other things in the system.

I appreciate any help.

+4
source share
1 answer

Angular 1.6 introduces some optimizations to the compiler that violate datepicker functionality (they are listed as breaking changes in the Angular changelist).

Angular Material ( ...), , Angular, , .

angular.module('myApp', []).config(function($compileProvider) {
    $compileProvider.preAssignBindingsEnabled(true);
});

, , $compileProvider , . , , $onInit(), Angular changelog

+5

Source: https://habr.com/ru/post/1663868/


All Articles