Problem with Angular ui.bootstrap.modal

Asked

Viewed 391 times

0

Starting a modal with ui.bootstrap.modal $uibModal, setei controller and controllerAs, in the console.log I see that the instance controller was started and the object loaded when clicked, but inside the modal I can not display the data, someone can help?

http://plnkr.co/edit/CK41JbKVjxUuZrAM3tNy?p=preview

1 answer

0

The mistake was caused by his WindowTemplatethat was generating a $scope and so in the modal HTML its vm was not accessible.

In index.html

Replace the line:

<script src="https://admin.marciodias.me/node_modules/angular-ui-bootstrap/dist/ui-bootstrap.js"></script>

For:

<script src="https://admin.marciodias.me/node_modules/angular-ui-bootstrap/dist/ui-bootstrap-tpls.js"></script>

In his ng-template modal remove the Divs <div class="inmodal"> and <div class="modal-dialog">

No controller.js

Remove the line:

windowTemplateUrl: 'modal-retailchain-product-edit.tpl.html',

Once this is done just access the vm in the html of the modal.

  • unsolved, I added the environment to plnkr http://plnkr.co/edit/CK41JbKVjxUuZrAM3tNy?p=preview

Browser other questions tagged

You are not signed in. Login or sign up in order to post.