gpt4 book ai didi

javascript - Angular bootstrap日历月 View 打开弹出问题

转载 作者:太空宇宙 更新时间:2023-11-04 15:32:40 25 4
gpt4 key购买 nike

我正在遵循一个例子here .

我想实现相同的功能,例如在月 View 中,当我单击事件时,它会打开一个包含详细信息的弹出窗口。但不知何故,我无法实现它。以下是我正在试验的代码,

     app.module('mwl.calendar.docs')
.controller('AppointmentsController',
function ($rootScope, $scope, CalenderService, $location, ProjREST_URL, $state,
moment,alert, calendarConfig, $timeout, propSettingService, DetailService) {

-----------------
-----------------
});
angular
.module('mwl.calendar.docs')
.factory('alert', function($uibModal) {

function show(action, event) {
return $uibModal.open({
templateUrl: 'modalContent.html',
controller: function() {
var vm = this;
vm.action = action;
vm.event = event;
},
controllerAs: 'vm'
});
}

return {
show: show
};

});

Controller 和工厂都在同一个js中但我收到错误,

Uncaught TypeError: app.module is not a function

我是 Angular 新手,所以我在这里做了一些愚蠢的事情:)非常感谢任何帮助。谢谢

<小时/>

更新后的代码看起来像,但错误仍然相同

angular.module('mwl.calendar.docs', ['mwl.calendar', 'ngAnimate', 'ui.bootstrap', 'colorpicker.module']);

app
.module('mwl.calendar.docs')
.controller('AppointmentsController',

最佳答案

您需要在注册 Controller 之前声明您的模块:

angular.module('mwl.calendar.docs', ['mwl.calendar', 'ngAnimate', 'ui.bootstrap', 'colorpicker.module']);

关于javascript - Angular bootstrap日历月 View 打开弹出问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44668881/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com