Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge pull request #1 from ambujkhanna/Event-and-property-Binding #2

Open
wants to merge 5 commits into
base: Event-and-property-Binding
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion angular-cli.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"tsconfig": "tsconfig.json",
"prefix": "app",
"styles": [
"styles.css"
"styles.css",
"../node_modules/bootstrap/dist/css/bootstrap.min.css"
],
"scripts": [],
"environments": {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"@angular/platform-browser": "^2.3.1",
"@angular/platform-browser-dynamic": "^2.3.1",
"@angular/router": "^3.3.1",
"bootstrap": "^3.3.7",
"core-js": "^2.4.1",
"rxjs": "^5.0.1",
"ts-helpers": "^1.1.1",
Expand Down
2 changes: 0 additions & 2 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,3 @@ alert('sss');

}


}
19 changes: 16 additions & 3 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,33 @@ import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import { RouterModule, Routes } from '@angular/router';

import { AppComponent } from './app.component';
import { innerComponent } from './inner/inner.component';
import { RoutingComponent } from './routing.component';

const routers: Routes = [
{path : '', redirectTo : '/Inner', pathMatch:'full'},
{ path: 'Inner', component: innerComponent },
{ path: 'Outer', component: AppComponent },
{ path: '**', redirectTo: '/Inner', pathMatch: 'full' }
]

@NgModule({
declarations: [
AppComponent, innerComponent
AppComponent,
innerComponent,
RoutingComponent
],
imports: [
BrowserModule,
FormsModule,
HttpModule
HttpModule,
RouterModule.forRoot(routers)
],
providers: [],
bootstrap: [AppComponent]
//bootstrap: [AppComponent]
bootstrap: [RoutingComponent]
})
export class AppModule { }
7 changes: 4 additions & 3 deletions src/app/inner/inner.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ <h2>NgStyle</h2>

<hr/>
<h2>*ngFor</h2>
<button (click)="addItems()"> Click Me</button>
<button (click)="addItems()"> Click Me</button>
<input type="text" [(ngModel)]="itemName" placeholder="Typing..."/>
<div *ngFor="let eachItem of repeatItems">
{{itemName}}
{{eachItem}}
{{title}}
</p>
</div>

<h1 class="md-col-12" *ngIf="showFlag"> showFlag is {{showFlag}}</h1>
<h1> ngIF condition</h1>
Expand All @@ -43,4 +43,5 @@ <h2>For Loop</h2>
<span [ngSwitchDefault] >{{list.name}}</span>
</div>-->

</div>
</div>

5 changes: 5 additions & 0 deletions src/app/inner/inner.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,9 @@ export class innerComponent{
addItems(){
this.repeatItems.push(this.eachItem);
}
<<<<<<< HEAD

}
=======
}
>>>>>>> cae5a08187c7915bcc1ff00bb17d0f8169cdb69a
6 changes: 6 additions & 0 deletions src/app/routing.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

<div class="col-md-12 col-lg-12">
<a routerLink='/Inner' class="link">Inner</a>
<a routerLink='/Outer' class="link">Outer</a>
</div>
<router-outlet></router-outlet>
14 changes: 14 additions & 0 deletions src/app/routing.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { Component, OnInit } from '@angular/core';

@Component({
selector: 'app-routing',
templateUrl: './routing.component.html'
})
export class RoutingComponent implements OnInit {

constructor() { }

ngOnInit() {
}

}
3 changes: 2 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>
<body>
<app-root>Loading...</app-root>
<!-- <app-root>Loading...</app-root> -->
<app-routing>Routing is Looding... </app-routing>
</body>
</html>
1 change: 1 addition & 0 deletions src/styles.css
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/* You can add global styles to this file, and also import other style files */
body{font-size:12px; color:#333}