我现在用的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