Originally created by: mg1357
Hello,
I use this code to show my modal service:
$scope.setEditModel = function (index) {
ModalService.showModal({
templateUrl: "/Views/_Modals/productEdit.html",
controller: "productEditController",
inputs: { scope: $scope, productIDScope: $scope.products[index].Id }
}).then(function (modal) {
// The modal object has the element built, if this is a bootstrap modal
// you can call 'modal' to show it, if it's a custom modal just show or hide
// it as you need to.
modal.element.modal();
modal.close.then(function (result) {
//$scope.message = result ? "You said Yes" : "You said No";
$scope.getProducts();
});
});
};
But it requires that Bootstrap.js script tag is included in the project.
Because including Bootstrap.js requires full jquery that is about +100KB I want to know is there a way that Modal service only uses jQuery Lite that included with Angularjs itself?
View and moderate all "tickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: tiagomsmagalhaes
you can use minified version of jquery.
View and moderate all "tickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: mg1357
So, isn't there any solution to prevent including Both jQuery and Bootstrap along with angular modal service?
View and moderate all "tickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: tiagomsmagalhaes
@mg1357 if you use the custom template in sampleapp.js
View and moderate all "tickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: onlywei
@dwmkerr I think the dependency on jQuery may be completely removed simply by fixing this line:
https://github.com/dwmkerr/angular-modal-service/blob/eff9e1ab34a6693a73c63b2278926a694de8a027/src/angular-modal-service.js#L17
to read
$document[0].bodyinstead of$document.find('body').