运行角度日历的官方例子

时间:2014-05-01 18:29:30

标签: javascript angularjs fullcalendar

我正在尝试运行angular-calendar组件的官方示例:http://angular-ui.github.io/ui-calendar/

但是,我收到错误: TypeError:undefined不是函数 - 显然函数 scope.calendar.fullCalendar 未定义

这是我包含的JS文件:

<script src="../public/components/angular/angular.js"></script>
<script src="../public/components/angular-bootstrap/ui-bootstrap-tpls.min.js"></script>
<script src="../public/components/jquery/jquery.min.js"></script>
<script src="../public/components/jquery-ui/ui/minified/jquery-ui.min.js"></script>
<script src="../public/components/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="../public/components/fullcalendar/fullcalendar.js"></script>
<script src="../public/components/fullcalendar/gcal.js"></script>
<script src="../public/components/angular-ui-calendar/src/calendar.js"></script>
<script src="../public/components/fullcalendar/gcal.js"></script>

你能帮我找到问题吗?

1 个答案:

答案 0 :(得分:8)

在 angular之前加载jQuery (在 jquery之后加载fullcalendar ):

<!-- First jQuery -->
<script src="../public/components/jquery/jquery.min.js"></script>
<script src="../public/components/jquery-ui/ui/minified/jquery-ui.min.js"></script>

<!-- then angular -->
<script src="../public/components/angular/angular.js"></script>
<script src="../public/components/angular-bootstrap/ui-bootstrap-tpls.min.js"></script>
<script src="../public/components/bootstrap/dist/js/bootstrap.min.js"></script>

<!-- fullcalendar -->
<script src="../public/components/fullcalendar/fullcalendar.js"></script>
<script src="../public/components/fullcalendar/gcal.js"></script>

<!-- angular-ui-calendar -->
<script src="../public/components/angular-ui-calendar/src/calendar.js"></script>