我正在尝试在我的角应用程序中实现模态服务。现在我正在使用Angular-modal服务(http://www.dwmkerr.com/the-only-angularjs-modal-service-youll-ever-need/)。使用角模式服务而不使用引导程序
博客表示,我们可以在没有bootstrap的情况下实现模式,但没有任何示例。 有什么帮助吗?
现在我试着用bootstrap也。但到目前为止没有运气。 这里是我的控制器
require([
'services/abcService',
'angular-services/angular-modal-service',
'libraries/bootstrap'
], function (app) {
"use strict";
abcController.$inject = ['angularModalService'];
function abcController(abcService, ModalService) {
var self = this;
abcService.getData().success(function (data) {
self.names = data.names;
});
self.show = function() {
ModalService.showModal({
templateUrl: 'abc.html',
controller: 'pqrController'
}).then(function (modal) {
modal.element.modal();
modal.close.then(function() {
console.log("hey !");
});
});
};
};
app.controller('abcController', abcController);
});
这里是pqrController
require([
'angular-services/angular-modal-service'
], function (app) {
"use strict";
function pqrController(close) {
this.close = function (result) {
close(result, 500);
};
};
app.controller('pqrController', pqrController);
});
现在,当我从控制器1调用Show()函数,我得到的模态的HTML上的底部屏幕。相反,它应该在屏幕上显示为模式。
该博客显示了一些关于自定义模式的代码示例[here](http://dwmkerr.github.io/angular-modal-service/)(滚动到最后一个示例)。 – 2014-09-11 06:50:08