app-routing.module.ts Now updated to Angular4 import { NgModule } from ‘@angular/core’; import { RouterModule, Routes } from ‘@angular/router’; import { HomeComponent } from ‘../dashboard/home/home.component’; import { DashboardComponent } from ‘../dashboard/dashboard.component’; import { TemplatedrivenformComponent } from ‘../dashboard/templatedrivenform/templatedrivenform.component’; import { TooltipComponent }…
Http and Observable in Angular2
//app.module.ts import { NgModule } from ‘@angular/core’; import { BrowserModule } from ‘@angular/platform-browser’; import { HttpModule} from ‘@angular/http’; import { studentListComponent } from ‘./student.List’; import { AppComponent } from ‘./app.component’; @NgModule({ imports: [ BrowserModule,HttpModule ], declarations: [ AppComponent,studentListComponent], bootstrap: […
Router in Angular2
app-routing.module.ts Now updated to Angular4 import { NgModule } from ‘@angular/core’; import { RouterModule, Routes } from ‘@angular/router’; import { HomeComponent } from ‘../dashboard/home/home.component’; import { DashboardComponent } from ‘../dashboard/dashboard.component’; import { TemplatedrivenformComponent } from ‘../dashboard/templatedrivenform/templatedrivenform.component’; import { TooltipComponent }…
Services in Angular2
Create a Employee service import { Injectable,Inject } from ‘@angular/core’; import { Http, Response } from ‘@angular/http’; import { Observable } from ‘rxjs/Observable’; import ‘rxjs/add/operator/catch’; import ‘rxjs/add/operator/map’; @Injectable() export class ServicesComponent { private _dataURL:string = “../../assets/data/output.json”; constructor(@Inject(Http) private _http: Http)…
Structural Directive in Angular2
There are three type of Structural directive in Angular 2 1) ngiF 2) ngFor 3) ngSwitch //app.component.ts import { Component } from ‘@angular/core’; @Component({ selector: ‘my-app’, template: ` <h1>Structural Directive ngiF</h1> <p *ngIf=”showHide”> ngIf structural directive content</p> <h1>Structural Directive ngFor</h1>…
Input and Output in Angular2
We can easily pass data within component but when we want to transfer data in another component Let’s say from parent to child or child to parent we have to use Input and Output for passing data from parent to…