How to use bootstrap 4 in angular 2?

后端 未结 11 2585
有刺的猬
有刺的猬 2020-11-30 18:54

I\'m building an angular 2 app written in typescript. It would use the bootstrap 4 framework in combination with some custom theming, is this possible?

The \"ng2-boo

11条回答
  •  醉话见心
    2020-11-30 19:25

    To use any visual library that needs JQuery just do the following:

    • Add the library css in the index;
    • Add the jquery js file to index;
    • Add the library js files in the index;
    • Install the library definition files (d.ts);
    • Install jquery definitions files (d.ts);

    If the library doesn't have definition files you could:

    • Create the definition yourself;
    • Create a global any variable with the same name of the library object, just to not get compiler errors;
    • Use with errors (this is the worst option);

    Now you can use the library inside Typescript;

提交回复
热议问题