Menu

#140 Modal service Only shows when Full jQuery is included

open
nobody
None
2016-03-18
2016-02-28
Anonymous
No

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?

Discussion

  • Anonymous

    Anonymous - 2016-02-29

    Originally posted by: tiagomsmagalhaes

    you can use minified version of jquery.

     
  • Anonymous

    Anonymous - 2016-02-29

    Originally posted by: mg1357

    So, isn't there any solution to prevent including Both jQuery and Bootstrap along with angular modal service?

     
  • Anonymous

    Anonymous - 2016-02-29

    Originally posted by: tiagomsmagalhaes

    @mg1357 if you use the custom template in sampleapp.js

     

Log in to post a comment.