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 ...