角度引导程序日历不显示

时间:2015-08-04 12:44:57

标签: javascript angularjs cordova calendar angular-ui-bootstrap

我正在尝试在我的apache cordova app中使用角度引导日历

HTML:

            <ion-view>
                <ion-content has-header="true" padding="true" ng-app="app" data-ng-controller="calendarController">
                    {{test}}
                    <mwl-calendar view="calendarView"
                      current-day="calendarDay"
                      events="events">
                </mwl-calendar>
                </ion-content>
            </ion-view>

控制器:

.controller('calendarController', ['$scope', '$state', 'moment', function ($scope, $state, moment) {

$scope.test = 'Test the controller';
$scope.calendarView = 'week';
$scope.calendarDay = new Date();
$scope.events = [
 {
     title: 'My event title', // The title of the event
     type: 'info',
     startsAt: new Date(2013, 5, 1, 1),
     endsAt: new Date(2014, 8, 26, 15),
     editable: false,
     deletable: false,
     incrementsBadgeTotal: true
 }
];
}]);

我已经包含了相关依赖项的链接,包括moment.js但是我收到一条消息“未设置传递给当前日期的值属性”。我确保moment.js链接在包含控制器的主app.js文件之前,如同类似问题中所建议的那样,但我仍然得到相同的消息。我是棱角分明的新人,非常感谢任何人提供的任何帮助。

1 个答案:

答案 0 :(得分:0)

如果您使用角度推进日历,则需要知道某些属性是强制性的。

我在html文件中没有看到任何 view-date 属性定义。而不是

 current-day="calendarDay"

尝试:

 view-date="calendarDay"

您可以查看官方项目的README文件以获取更多详细信息。

相关问题