MEAN Stack Web Development Lab Manual (Week 1-13) - Student Version
MEAN Stack Web Development Lab Manual (Week 1-13) - Student Version
School of Engineering
Computer Science Engineering
A. Installation of Software
1. Install Visual Studio
2. Install Node JS
a. Check version of Node and NPM installed
3. Install TypeScript
a. Check Version of TypeScript
b. Get help of TypeScript
c. Practice TypeScript
Procedure:
1. Install Visual Studio Code Software
Download Visual Studio Code - Mac, Linux, Windows
3. Install TypeScript
Enter npm install -g typescript
// 1. Declaration of Number
let first: number=25; // number
let second: number = 0x37CF; // hexadecimal
let third: number = 0o377 ; // octal
let fourth: number = 0b111001; // binary
console.log("decimal value of 25: " + first) // 123
console.log("hexadecimal value of 25: " + second); // 14287
console.log("octal value of 25: " + third); // 255
console.log("binary value of 25: " + fourth);
Write JS file:
Output:
// 2. Declaration of String
let str:string = "MALLAREDDY UNIVERSITY"
console.log("string is: "+str);
Write JS file:
Output:
val1 = 555; // OK
console.log("value using any: " + val1) ;
val1 = true; // OK
console.log("value using any: " + val1) ;
Write JS file:
Output:
Write JS file:
Output:
Output:
Output:
Output:
display() {
console.log(this.rollNumber);
console.log(this.studentName);
}
}
FullName(); //function
GetAge(); //function
}
FullName() {
return this.firstName + ' ' + this.lastName;
}
GetAge() {
return this.age;
}
Output:
// Employee1.ts
import { Employee } from "./Employeemodule";
Output:
Procedure:
1. Install Angular CLI
Check Version of Angular
2. Create Angular Project
3. Install Bootstrap and Configure Bootstrap
4. Open Project in Visual Studio Code and Build Project
5. Run Project
Note:
If you are unable to run from Terminal and getting error “PS1 Can Not Be
Loaded Because Running Scripts Is Disabled On This System In Angular”,
run the following commands on Terminal.
1. set-ExecutionPolicy RemoteSigned -Scope CurrentUser
2. Get-ExecutionPolicy
3. Get-ExecutionPolicy –list
Procedure:
1. Install Angular CLI
Install the CLI using the npm package manager:
npm install –g @angular/cli
3. Install Bootstrap
npm install bootstrap -save
Objective:
To create a Website with Custom Components
Procedure:
1. Create Angular Project
2. Install Bootstrap and Configure Bootstrap
3. Open Project in Visual Studio Code
4. Create Custom Components: home, about, services, contact, gallery
5. Add Custom Components to app.component.html file
6. Run Project
Website Template
Objective:
To create a Single Page Application (SPA) Website with Custom
Components using Routing.
Procedure:
Step 1: Create New Angular Project with Routing Option
Step 2: Install bootstrap and configure to the Project
Step 3: Create Components: home, services, about, contact and gallery
Step 4: Update app.component.html file with navbar, Router Outlet and other
components
Step 5: Update app-routing.module.ts file
Import Components
Add Route Configuration
Step 6: Run Project
Website Template
Click on Home, Services and Gallery links and observe dynamic display of
content below navbar.
Objective:
To create Angular Project and Implement Data Binding Concepts
Procedure:
Step 1: Create New Angular Project with Routing Option
Step 2: Install bootstrap and configure to the Project
Step 3: Update app.component.html file with navbar and add Student Details
using Data Binding Concept.
Step 4: Declare variables in app.component.ts file
Step 5: Run Project
Note:
Use Your Personal Details
Objective:
To create Angular Project and Implement Data Binding Concepts
Procedure:
Step 1: Create New Angular Project with Routing Option
Step 2: Install bootstrap and configure to the Project
Step 3: Update app.component.html file with navbar and Data Binding
Examples
Step 4: Declare variables in app.component.ts file
Step 5: Add import {FormsModule} from '@angular/forms'; in app.modules.ts
(Required for ngModel)
Step 6: Run Project
Objective:
To create Angular Project and Implement Angular Directives
Procedure:
Step 1: Create New Angular Project with Routing Option
Step 2: Install bootstrap and configure to the Project
Step 3: Update app.component.html file Directives Examples
Step 4: Declare variables in app.component.ts file
Step 5: Run Project
Objective:
To collect Form data using Brower Events
Procedure:
Step 1: Create New Angular Project
Step 2: Install bootstrap and configure to the Project
Step 3: Create HTML Form in app.component.html file
Step 4: Collect and Validate Data using Brower Events in app.component.ts file
Step 5: Run Project
Objective:
To implement Pipe concept in Expressions to modify the result of
expression for display in a view.
Procedure:
Step 1: Create New Angular Project
Step 2: Install bootstrap and configure to the Project
Step 3: Create HTML and Bind Data along with Pipes in app.component.html
Step 4: Declare Variables in app.component.ts file
Step 5: Run Project
Step 3: Create HTML and Bind Data along with Pipes in app.component.html
Output:
Objective:
To Collect Data through Login Form using Template-Driven Forms
Procedure:
Step 1: Create New Angular Project
Step 2: Install bootstrap and configure to the Project
Step 3: Create Login Form in app.component.html
Step 4: Collect Data on Form Submission in app.component.ts file
Step 5: Run Project
Output:
Objective:
To load data from Local JSON file using HttpClient Module
Procedure:
Step 1: Create New Angular Project
Step 2: Install bootstrap and configure to the Project
Step 3: Create Service Component
ng g service [service name]
Step 4: Import HttpClientModule in app.module.ts
import { HttpClientModule } from '@angular/common/http’;
Step 5: Create Service in http-service.ts file (Service Component)
Step 6: Consume GetData method of Service Class in app.component.ts file
Step 7: Display Data using *ngFor and Interpolation in app.component.ts file
Step 8: Run Project
Output:
Objective:
To work on MongoDB including Installation, Configuration, Creation of
Database, Managing Collections and Documents.
Procedure:
Step 1: Download MongoDB Community Server (version 5.0.9) from
https://www.mongodb.com/try/download/community
Creating Databases
Your created database (MRU) is not present in list. To display database,
you need create collection and need to insert at least one document into it.
db.createCollection(‘student’)
Drop collections
db.student.drop()
Deleting Databases
db.dropDatabase()
MEAN Stack Web Development Lab Manual
Copying Databases
db.copyDatabase(‘mru’, ‘mru1’)