diff --git a/angular/angular1.md b/angular/angular1.md new file mode 100644 index 0000000..69fb43c --- /dev/null +++ b/angular/angular1.md @@ -0,0 +1,212 @@ +### :camel: Angular examples +--- + +#### Task1: Create a component to display Hello World + +``` + +ng generate component helloworld + +app-routing.module.ts + +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; +import { HelloworldComponent } from './helloworld/helloworld.component'; + +const routes: Routes = [ + { path: 'hello', component: HelloworldComponent } +]; + +@NgModule({ + imports: [RouterModule.forRoot(routes)], + exports: [RouterModule] +}) +export class AppRoutingModule { } + +app.component.html + + + + +``` + +#### Task2: Create angular component calculator + +![Screenshot](cal.png) + +``` +app.module.ts +import { BrowserModule } from '@angular/platform-browser'; +import { NgModule } from '@angular/core'; + +import { AppComponent } from './app.component'; +import { CalcComponent } from './calc/calc.component' +import { FormsModule } from '@angular/forms'; + +@NgModule({ + declarations: [ + AppComponent, + CalcComponent + ], + imports: [ + BrowserModule, + FormsModule + ], + providers: [], + bootstrap: [AppComponent] +}) +export class AppModule { } + +app.component.ts + +import { Component } from '@angular/core'; + +@Component({ + selector: 'app-root', + templateUrl: './app.component.html', + styleUrls: ['./app.component.css'] +}) +export class AppComponent { + title = 'app'; +} + +app.component.html + +
+ +
+ +calc.component.html +
+
+

+ Calculator component +

+
+ +
+
+
+
+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+
+ + Result : {{result}} + +
+
+
+
+
+ +calc.component.ts + +import { Component } from '@angular/core'; + +@Component({ + selector: 'calc', + templateUrl: 'calc.component.html', + styleUrls: ['calc.component.css'] +}) +export class CalcComponent { + public number1 : number; + public number2 : number; + public result : number; + + public add(){ + this.result = this.number1 + this.number2 + } +} +``` + +#### Task3: Create a component to display the heros list as shown below + +![Screenshot](heros-list.png) + +``` + +useful commands + +ng new angular-hero-app + +ng g c heroes +ng g c hero-detail +ng g c messages + +npm i ng2-search-filter --save + +``` + + +#### Task4: Create a component to handle the messages + +![Screenshot](messages.png) + +``` + +useful commands + +ng new angular-hero-app + +ng g c heroes +ng g c hero-detail +ng g c messages + +npm i ng2-search-filter --save + +``` + +#### Task5: Create a component to handle the hero details + +![Screenshot](hero-detail.png) + +``` + +useful commands + +ng new angular-hero-app + +ng g c heroes +ng g c hero-detail +ng g c messages + +npm i ng2-search-filter --save + +``` + +#### Task5: Create a component to handle the delete + +![Screenshot](hero-delete.png) + +``` + +useful commands + +ng new angular-hero-app + +ng g c heroes +ng g c hero-detail +ng g c messages + +npm i ng2-search-filter --save + +``` diff --git a/angular/cal.png b/angular/cal.png new file mode 100644 index 0000000..4a0735b Binary files /dev/null and b/angular/cal.png differ diff --git a/angular/calc.component.css b/angular/calc.component.css new file mode 100644 index 0000000..20ca28c --- /dev/null +++ b/angular/calc.component.css @@ -0,0 +1,101 @@ +.grid{ + width: 100% +} + +.row{ + width: 100%; + display: flex; +} + + +.col-1 { + width: 8.33%; +} + +.col-2 { + width: 16.66%; +} + +.col-3 { + width: 25%; +} + +.col-4 { + width: 33.33%; +} + +.col-5 { + width: 41.66%; +} + +.col-6 { + width: 50%; +} + +.col-7 { + width: 58.33%; +} + +.col-8 { + width: 66.66%; +} + +.col-9 { + width: 75%; +} + +.col-10 { + width: 83.33%; +} + +.col-11 { + width: 91.66%; +} + +.col-12 { + width: 100%; +} + +.header{ + width: 100%; + background-color: #003A60; + height: 100px; +} + +.header h2{ + line-height: 100px; + color: #fff; +} + +.button { + background-color: #4CAF50; /* Green */ + border: none; + color: white; + padding: 15px 32px; + text-align: center; + text-decoration: none; + display: inline-block; + font-size: 16px; + margin: 4px 2px; + cursor: pointer; +} + +input{ + border: none; + border-bottom: 1px solid grey; + width: 80%; + margin: 0% 10%; + padding: 5%; +} + +.result{ + background-color: #ddffff; + width: 80%; + margin: 20px 10px 10px 10px; + height: 100px; + border-left: 3px solid #2196F3; +} + +.result span{ + line-height: 100px; +} \ No newline at end of file diff --git a/angular/hero-delete.png b/angular/hero-delete.png new file mode 100644 index 0000000..cb55f40 Binary files /dev/null and b/angular/hero-delete.png differ diff --git a/angular/hero-detail.png b/angular/hero-detail.png new file mode 100644 index 0000000..d198634 Binary files /dev/null and b/angular/hero-detail.png differ diff --git a/angular/heros-list.png b/angular/heros-list.png new file mode 100644 index 0000000..225816a Binary files /dev/null and b/angular/heros-list.png differ diff --git a/angular/messages.png b/angular/messages.png new file mode 100644 index 0000000..9a8bf05 Binary files /dev/null and b/angular/messages.png differ diff --git a/html/html1-form6.png b/html/html1-form6.png new file mode 100644 index 0000000..6d1668d Binary files /dev/null and b/html/html1-form6.png differ diff --git a/html/html1.md b/html/html1.md index e74d160..687df87 100644 --- a/html/html1.md +++ b/html/html1.md @@ -203,4 +203,154 @@ +``` + +#### Task6: Create the below form using HTML + +![Screenshot](html1-form6.png) + +``` + + + + + + + + +

REGISTRATION FORM

+
+ +

Name:

+ +
+ +

Address: +

+ +
+ +

E-mail Address:

+ +
+ +

Password:

+ +
+ +

Telephone:

+ +
+ + +

+ SELECT YOUR COURSE + +

+ +
+
+ +

Comments:

+ + +

+ + +

+ +
+ + + ``` \ No newline at end of file diff --git a/html/regform.html b/html/regform.html new file mode 100644 index 0000000..cf29fae --- /dev/null +++ b/html/regform.html @@ -0,0 +1,142 @@ + + + + + + + + +

REGISTRATION FORM

+
+ +

Name:

+ +
+ +

Address: +

+ +
+ +

E-mail Address:

+ +
+ +

Password:

+ +
+ +

Telephone:

+ +
+ + +

+ SELECT YOUR COURSE + +

+ +
+
+ +

Comments:

+ + +

+ + +

+ +
+ + \ No newline at end of file