0
votes

I have a hello world - angular(v1.4.9 ) with ui bootstrap(bootstrap-tpls versioned 1.2.5) modal box code written in this jsfiddle.

On chrome, when i click Open Me button, it throws error:

Error while parsing the 'sandbox' attribute: 'allow-modals' is an invalid sandbox flag.

On firefox, neither the modal opens nor there is any error message.

I ran the same code on my local machine, it throws error:

Unknown provider: $modalProvider`.

How can i fix the code to open a modal box?

1
Violating the code-in-question requirement aside, what exactly do you want us to fix? - unbindall
Your code is very confusing - amanuel2

1 Answers

1
votes

Your fiddle doesn't work for several reasons ... no ng-app and the code is wrapped in the default onload in the javascript settings menu.

Once you fix that you need to use more current $uibModal service as per the docs:

skAngApp.controller('ModalDemoCtrl', function ($scope, $uibModal, $log) {

  $scope.open = function (size) {

    var modalInstance = $uibModal.open({
      templateUrl: 'myModalContent.html'
    });

})

DEMO