以下是我采取的步骤:
1) 我从以下地址下载了脚本文件:https://github.com/doodeec/dcom-angular-dialog
2) 包含在我的网页和我的申请中:
var summariesApp = angular.module('summariesApp', ['ui.bootstrap', 'ngCkeditor', 'dcModal']);
3) 试图在 Controller 中使用它:
summariesApp.controller("singleSNPController", function ($scope, $http) {
$scope.stopLightModal = dialogService.create('../Templates/test.html');
我收到一条错误消息,提示未找到 dialogService 资源。我知道这个问题有点简单,但我已经坚持了一段时间了。提前致谢。
最佳答案
尝试像这样将 dialogService 注入(inject)到您的 Controller 中:
summariesApp.controller("singleSNPController", function ($scope, $http, dialogService) {
$scope.stopLightModal = dialogService.create('../Templates/test.html');
看看例子here ,您将看到他们如何将 dialogService 注入(inject) Controller 。
关于javascript - 在 Controller 中调用它时出现 ng-modal 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26871862/