简体   繁体   中英

Angular-material Date-Picker doesn't work

Can anyone help me why angular-material date-picker doesn't work? My cshtml have the following code:

  <label>Date and time</label>
    <md-content>
        <md-datepicker ng-model="viewModel.employee.contractExpireDate" md-placeholder="Enter date">

        </md-datepicker>
    </md-content>

And i have the following dependencies

var companyApp = angular.module('company', ['ui.router', 'ngResource','ngAria','ngAnimate', 'ngMaterial']);

Do i need to add something or to install any package except angular-material?

  <script type="text/javascript">
        // Need to add a dependency on the 'ui.bootstrap' module to use
        // Angular-UI Bootstrap
        var app = angular.module('myApp', ['ui.bootstrap']);

        app.controller('MyDateController', function ($scope) {
            $scope.date = new Date();
            $scope.date.setSeconds(0);
        });
    </script>
<div ng-controller="MyDateController">

        <div style="width: 300px">
            <input type="text"
                class="form-control"
                datepicker-popup="yyyy/MM/dd"
                ng-disabled="isOpen"
                ng-model="date"
                is-open="isOpen"
                ng-click="isOpen = true" />
        </div>
        <h2>Time</h2>
        <timepicker ng-model="date">
        </timepicker>
        <hr>
        <h2>Currently Selected Date: {{date | date:'medium'}}
        </h2>
    </div>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM