Как я могу использовать bootstrap4 всплывающие окна и модалы в Angular 6 Project - PullRequest
0 голосов
/ 26 марта 2019

Angular.json

"styles": [        
      "./node_modules/bootstrap/dist/css/bootstrap.min.css",
                        "./node_modules/ngx-bootstrap/datepicker/bs-datepicker.css",
                        "src/styles.css"
                    ],
                    "scripts": ["../node_modules/jquery/dist/jquery.js",
                        "../node_modules/tether/dist/js/tether.js",
                        "../node_modules/bootstrap/dist/js/bootstrap.js"
                    ],

Я хочу использовать загрузочный модал в своем угловом проекте, но я не могу этого сделать, даже если я ввожу все модули и импортировал их в файл angular.json, но Bootstrap Model не работает.

Модальный код в Component.html

<!-- Button trigger modal -->
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal">
Launch demo modal
 </button>

<!-- Modal-->
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
     <div class="modal-dialog" role="document">
       <div class="modal-content">
        <div class="modal-header">
            <h5 class="modal-title" id="exampleModalLabel">Modal title</h5>
            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
        <span aria-hidden="true">&times;</span>
    </button>
        </div>
        <div class="modal-body">
            ...
        </div>
        <div class="modal-footer">
            <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
            <button type="button" class="btn btn-primary">Save changes</button>
        </div>
    </div>
</div>

1 Ответ

0 голосов
/ 26 марта 2019

Я бы порекомендовал использовать ng-bootstrap, у них есть Модал . Нажмите здесь для получения инструкций по установке. И здесь для примера Модал

...