2016-05-21 11 views
0

角度材料の日付ピッカーが機能しない理由を教えてもらえますか?私は何かを追加したり、角度、材料以外の任意のパッケージをインストールする必要がありますか角度材料ピックアップが機能しない

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

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

と私は次の依存

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

を持っている: 私CSHTMLは、次のコードを持っていますか?

+0

あなたはフィギュアかプランカを共有できますか? – Rayon

+0

私のためにうまくいく... https://jsfiddle.net/rayon_1990/suunyz3e/208/ – Rayon

答えて

0
<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> 
関連する問題