我現在用的MD-日期選擇指令從角的材料,但是我想在日期TYP,不僅從日期選擇器選擇它MEANjs另一個日期備考。我發現下面的示例代碼:設置在與MD-日期選擇器
angular.module('MyApp')
.controller('AppCtrl', function($scope) {
$scope.myDate = new Date();
$scope.minDate = new Date(
$scope.myDate.getFullYear()-1,
$scope.myDate.getMonth(),
$scope.myDate.getDate());
$scope.maxDate = new Date(
$scope.myDate.getFullYear()+1,
$scope.myDate.getMonth(),
$scope.myDate.getDate()); })
.config(function($mdDateLocaleProvider) {
$mdDateLocaleProvider.formatDate = function(date) {
return date ? moment(date).format('DD.MM.YYYY') : '';
};
$mdDateLocaleProvider.parseDate = function(dateString) {
var m = moment(dateString, 'DD.MM.YYYY', true);
return m.isValid() ? m.toDate() : new Date(NaN);
};
});
我現在的問題是在哪裏使用的.config部分在MEANJS自耕農發電機的應用。我找不到任何東西。有人這樣做了嗎?
到目前爲止,我把它在我的控制器等,並安裝了片刻,注入但不知何故,它不能被發現。 – d8ta