简体   繁体   English

角材料日期选择器不起作用

[英]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: 我的cshtml具有以下代码:

  <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>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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