Router with parameter 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 }…

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)…