Using a Bootstrap modal in Angular

As an example of using Angular lifetime events, this section shows how to use a Bootstrap modal in Angular. As a first step, Bootstrap and jQuery must be installed in package.json. The @types/... packages that contain TypeScript declarations for them are also required:

{  ...  "dependencies": {     ...    "jquery": "^3.3.1",    "bootstrap": "^4.1.3"  },  "devDependencies": {    ...    "@types/jquery": "^3.3.7",    "@types/bootstrap": "^4.1.2",    ...  }}

Please use a Bootstrap version greater than 4.0, since the remainder of the chapter assumes it. 

Then, jQuery and Bootstrap JavaScript together with Bootsrap CSS must be declared as globally visible throughout the whole application by inserting them into the application styles and ...

Get Hands-On TypeScript for C# and .NET Core Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.