Skip to main content

How to include Bootstrap & Jquery in Angular 11 app

 3 Steps:

  1. Step 1 : Installing Angular CLI
  2. Step 2: Installing Bootstrap and Jquery in our project
  3. Step 3: Adding Bootstrap and jquery in our project using angular.json  

Step 1 : Installing Angular CLI 

If Angular CLI is not installed in your machin yet, Install it firs by using the below command in a new terminal.

$ npm install -g @angular/cli

Now, Create a new Angular project by using the ng utility.

$ ng new myApp

Now navigate to your root of the project by using 

$ cd myApp

Now we can serve the Angular app by using 

$ ng serve

This command will run the application in the default port http://127.0.0.1:4200/

Step 2 — Installing Bootstrap & Jquery in Your Angular Project

Go back to your command-line interface and install Bootstrap 4 via npm as follows:

$ npm install bootstrap

Next, you also need to install jQuery using the following command:

$ npm install jquery

Step 3 :  Adding Bootstrap & Jquery to Angular Using angular.json

Now open angular.json file from your project root

In your projects->architect->build->styles array,

node_modules/bootstrap/dist/css/bootstrap.css

In your  projects->architect->build->scripts array,

node_modules/bootstrap/dist/js/bootstrap.js
In your   projects->architect->build->scripts array,
node_modules/bootstrap/dist/js/bootstrap.js
Now restart your server and Bootstrap and Jquery is added into your application.

Image taken from freepik

Comments

Popular posts from this blog

When there is.... It matters!

When there is no wind... It matters to see a tree dance! When there is no way home... It matters to keep a thin memory! When there is no light... It matters to keep a lighter! When there is no sweetheart... It matters by surrounded with friends! When there is no sweet memory to remember... It matters to create them by own! When there is no achievement... It matters to grab an opportunity! When there is no plan... It matters to hit hard the goal! When there is a heart... It matters to keep it unbroken! When there is  no knowledge... It matters to get rich! When there is no path... It matters to keep thoughts clear! When there is   no hope... It matters to keep motivated! When there is no life... It matters to remember YOU ARE THE LIFE

VSCode for web developers.

Visual Studio Code:  Visual Studio Code is a freeware source-code editor made by Microsoft for Windows, Linux, and macOS. Features include support for debugging, syntax highlighting, intelligent code completion, snippets, code refactoring, and embedded Git. Download VSCode: We can download VSCode by this  download link.  Select an installer based on your operating system and install it. Creating a new HTML file: Open VSCode Click ctrl+b (It will open the file explorer on the left side.) Choose your folder or in the root of your folder Click the new file in the top right corner of the explorer gives a name with the extension (Ex: inde.html). Write some HTML code. Click ctrl+s to save the file. Now browse the file in any of your favorite browsers to see your web page.

Why web browser need for HTML (Website)?

Purpose of web browser  The main purpose of a web browser is to read and render the HTML document into human-readable and formatted content. Common browsers There are many browsers available in the web era, and these are some commonly used browsers worldwide. Chrome Edge Firefox Safari Opera HTML page structure <html> <head> <title>Page title</title> </head> <body> <h1>This is a heading</h1> <p>This is a paragraph.</p> <p>This is another paragraph.</p> </body> </html> The HTML's timeline There have been many versions of HTML till now over the journey of the W orld W ide W eb. Year Version 1989 Tim Berners-Lee invented www 1991 Tim Berners-Lee invented HTML 1993 Dave Raggett drafted HTML+ 1995 HTML Working Group defined HTML 2.0 1997 W3C Recommendation: HTML 3.2 1999 W3C Recommendation: HTML 4.01 2000 W3C Recommendation: XHTML 1.0 2008 WHATWG HTML5 First Public Draft 2012 WHATWG HTML5 Living ...