Posts

Showing posts from May, 2017

Router Example in Angular2

Image
Hi All, In this blog I am going to show you how you can implement the Routing in Angular2 application. To Starts with this we need to create following files in your application: 1. home.component.ts (under home folder) 2. login.component.ts (under login folder) 3. app.component.ts 4. main.ts 5. index.html create a folder with name home and then create a file with name  home.component.ts with below contents: ==================================================================== home.component.ts ==================================================================== import {Component} from 'angular2/core'; @Component({   selector: 'home',   template: `       <h1>My Home Page</h1>   ` }) export class Home {   constructor() {   } } create a folder with name login and then create a file with name  login.component.ts with below contents: ====================================================================...

Setting up the environment for Angular2 and Hello World Example in Angular2

Image
Hi All, In this post I am going you to show you how you can set up the environment for Angular2. You may want to run your application in different servers. So here I am going to show you how you can run your Angular2 application in the following two servers: 1. lite-server (static server) 2. Weblogic Server 10.3 Lets do the setup for lite server.  First of all go to any directory in your computer and create a folder in that directory with name "angular2-example". You can do it by the command line also by typing the following command. mkdir  angular2-example Now once the directory is created you need to create three files. 1. tsconfig.json 2. typings.json 3. package.json 1.  tsconfig.json This file is TypeScript compiler configuration file. It guides the compiler to generate JavaScript files after compilation. The content of this file will be as follows: {   "compilerOptions": {     "target": "es6",     "modu...