Using bootstrap components in angular 2

Angular 2 cli allows you to add bootstrap js components and use them in project components.

While other bootstrap libraries exist, such as ng-bootstrap , built specifically for angular 2.

I was wondering what are the differences between the two approaches and is it ok to use bootstrap components in angular 2, just npm install bootstrap and include it in application scripts in angular-cli.json

+4
source share
2 answers

Using the npm package for bootstrapping basically adds some extra input bindings to help you do something useful.

from reddit ,

ng-bootstrap gives you input bindings Angularfor all the parameters you may need to configure. If you just do the basics, it doesn't really matter. But as soon as you need to access the Bootstrap property, which is not controlled by the CSS class, then with vanilla In bootstrap, you need to make very non-glossy $ (dom-id) links in your Javascript logic, whereas if you use ng-bootstrap, then the action performed by setting the property associated with ng-bootstrap.

jquery. , jquery, . . . ng2 booleans, , .

. , .

ng- -: * jquery

  • es2015

  • ,

0

jquery + bootstrap.

, .

0

Source: https://habr.com/ru/post/1662121/


All Articles