<!DOCTYPE html>
<html>

  <head>
    <base href="." />
    <title>angular playground</title>
    <link rel="stylesheet" href="style.css" />
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
    <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
  
    <script src="https://unpkg.com/core-js@2.4.1/client/shim.min.js"></script>
    <script src="https://unpkg.com/zone.js/dist/zone.js"></script>
    <script src="https://unpkg.com/zone.js/dist/long-stack-trace-zone.js"></script>
    <script src="https://unpkg.com/reflect-metadata@0.1.3/Reflect.js"></script>
    <script src="https://unpkg.com/systemjs@0.19.31/dist/system.js"></script>
    <script src="config.js"></script>
    <script>
    System.import('app')
      .catch(console.error.bind(console));
  </script>
  </head>

  <body>
    <my-app>
    loading...
  </my-app>
  </body>

</html>
/* Styles go here */

ul.items {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin: 0;
  padding: 0;
}
ul.items > li {
    line-height: 20px;
    list-style-type: none;
    text-align: center;
    width: 100%;
    margin: 10px;
    padding: 10px;
    font-weight: bold;
    background: linear-gradient(146deg, #ff7500, #ffffff, #ffffff, #00a253);
    color: #007cff;
    box-shadow: -6px 2px 13px rgba(0, 0, 0, 0.15), 5px 2px 13px rgba(0, 0, 0, 0.15);
}

.pointer{
  cursor:pointer;
}
### Angular Starter Plunker - Typescript
System.config({
  //use typescript for compilation
  transpiler: 'typescript',
  //typescript compiler options
  typescriptOptions: {
    emitDecoratorMetadata: true
  },
  paths: {
    'npm:': 'https://unpkg.com/'
  },
  //map tells the System loader where to look for things
  map: {
    
    'app': './src',
    
    '@angular/core': 'npm:@angular/core/bundles/core.umd.js',
    '@angular/common': 'npm:@angular/common/bundles/common.umd.js',
    '@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js',
    '@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js',
    '@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
    '@angular/http': 'npm:@angular/http/bundles/http.umd.js',
    '@angular/router': 'npm:@angular/router/bundles/router.umd.js',
    '@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js',
    '@angular/animations': 'npm:@angular/animations/bundles/animations.umd.js',
    '@angular/platform-browser/animations': 'npm:@angular/platform-browser/bundles/platform-browser-animations.umd.js',
    '@angular/animations/browser': 'npm:@angular/animations/bundles/animations-browser.umd.js',
    
    '@angular/core/testing': 'npm:@angular/core/bundles/core-testing.umd.js',
    '@angular/common/testing': 'npm:@angular/common/bundles/common-testing.umd.js',
    '@angular/compiler/testing': 'npm:@angular/compiler/bundles/compiler-testing.umd.js',
    '@angular/platform-browser/testing': 'npm:@angular/platform-browser/bundles/platform-browser-testing.umd.js',
    '@angular/platform-browser-dynamic/testing': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic-testing.umd.js',
    '@angular/http/testing': 'npm:@angular/http/bundles/http-testing.umd.js',
    '@angular/router/testing': 'npm:@angular/router/bundles/router-testing.umd.js',
    
    'rxjs': 'npm:rxjs',
    'typescript': 'npm:typescript@2.2.1/lib/typescript.js'
  },
  //packages defines our app package
  packages: {
    app: {
      main: './main.ts',
      defaultExtension: 'ts'
    },
    rxjs: {
      defaultExtension: 'js'
    }
  }
});
//main entry point
import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
import {AppModule} from './app.module';

platformBrowserDynamic().bootstrapModule(AppModule)
import { NgModule } from '@angular/core'
import { BrowserModule } from '@angular/platform-browser'
import { FormsModule  } from '@angular/forms';
import { Router, RouterModule } from '@angular/router';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';


import { AppComponent } from './app/app.component';
import { HomeComponent } from './app/home.component';
import { AboutComponent } from './app/about.component';
import { ContactComponent } from './app/contact.component';

const appRoutes: Routes = [
  
  { path: '', redirectTo: '/home', pathMatch: 'full' },
  { path: 'home',   component: HomeComponent },
  { path: 'about',  component: AboutComponent },
  { path: 'contact',  component: ContactComponent }
];



@NgModule({
  imports: [
    BrowserModule, FormsModule, BrowserAnimationsModule,
    RouterModule.forRoot(appRoutes,{ enableTracing: true } )
  ],
  declarations: [ AppComponent, HomeComponent, AboutComponent, ContactComponent ],
  exports: [],
  bootstrap: [ AppComponent ]
})
export class AppModule {}
import {Component} from '@angular/core'

@Component({
  selector: 'app-child-component',
  template: `
    <div>
      <h3>I'm the Child component</h3>
    </div>
  `,
})
export class ChildComponent {}
<h4>Contact Us</h4>
<hr />

<div class='row' [@rotateIn] ='in'>
  <div class='col-sm-12'>
    <div class="card" >
      <div class="card-header">
        About Us
      </div>
      <ul class="list-group list-group-flush">
        <li class="list-group-item">We are experience developer</li>
        <li class="list-group-item">We provide solution for any problem</li>
        <li class="list-group-item">We can work on any technology</li>
        <li class="list-group-item">We know more computer languages than anyone can speak.</li>
      </ul>
    </div>
  </div>
</div>
import { Component } from '@angular/core'
import { Component, OnInit } from '@angular/core';
import { rotateIn } from './animations'

@Component({
  selector: 'about-comp',
  templateUrl: './src/app/about.component.html',
  animations: [rotateIn]
})
export class AboutComponent implements OnInit{ 
  
   constructor() { }
   
   ngOnInit(){
     
   }
   
}
import { trigger, state, style, animate, transition, keyframes } from '@angular/animations';

export const flyin = [
  trigger('flyin', [
      state('in', style({transform: 'translateX(0)'})),
      transition('void => *', [
        style({transform: 'translateX(-100%)'}),
        animate('700ms ease-in')
        
      ])
    ]) 
];

export const rotateIn = [
  trigger('rotateIn', [
      state('in', style({transform: 'translateX(0)'})),
      transition('void => *', [
        style({transform: 'rotate(-180deg)'}),
        animate('700ms ease-out')
        
      ])
    ]) 
];

export const flyFromBottom = [
  trigger('flyFromBottom', [
      state('in', style({transform: 'translateY(0)'})),
      transition('void => *', [
        style({transform: 'translateY(100%)'}),
        animate('700ms ease-in')
        
      ])
    ]) 
];

export const flyItems = [
  trigger('flyItems', [
    state('in', style({transform: 'translateX(0)'})),
    transition('void => *', [
      animate(700, keyframes([
        style({opacity: 0, transform: 'translateX(-100%)', offset: 0}),
        style({opacity: 1, transform: 'translateX(0)',     offset: 1.0})
      ]))
    ]),
    transition('* => void', [
      animate(500, keyframes([
        style({opacity: 1, transform: 'translateX(0)',     offset: 0}),
        style({opacity: 0, transform: 'translateX(100%)',  offset: 1.0})
      ]))
    ])
  ])
];
<nav class="navbar navbar-expand-sm navbar-light bg-light">
  <a class="navbar-brand" href="#">Animation</a>
  <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
    <span class="navbar-toggler-icon"></span>
  </button>

  <div class="collapse navbar-collapse" id="navbarSupportedContent">
    <ul class="navbar-nav mr-auto">
      <li class="nav-item" routerLinkActive="active">
        <a class="nav-link" routerLink="/home" >Home</a>
      </li>
      <li class="nav-item" routerLinkActive="active">
        <a class="nav-link" routerLink="/about" >About</a>
      </li>
      <li class="nav-item" routerLinkActive="active">
        <a class="nav-link" routerLink="/contact" >Contact</a>
      </li>
    </ul>
  </div>
</nav>

<div class='container'>
  <router-outlet></router-outlet>
</div>
import {Component} from '@angular/core'
import { Component, OnInit } from '@angular/core';


@Component({
  selector: 'my-app',
  templateUrl: './src/app/app.component.html'
})
export class AppComponent implements OnInit{ 
   isActive: boole = false;
   constructor() { }
   
   ngOnInit(){
     
   }
   
}
<div [@flyFromBottom] ='in'>
  <h4>Contact Us</h4>
  <hr />
  
  <p>Here contact information will go</p>
  <p>
    Router links
  Now you have routes configured and a place to render them, but how do you navigate? The URL could arrive directly from the browser address bar. But most of the time you navigate as a result of some user action such as the click of an anchor tag.
  
  Consider the following template
  </p>
</div>
import { Component } from '@angular/core'
import { Component, OnInit } from '@angular/core';
import { flyFromBottom } from './animations'

@Component({
  selector: 'about-comp',
  templateUrl: './src/app/contact.component.html',
  animations: [ flyFromBottom ]
})
export class ContactComponent implements OnInit{ 
  
   constructor() { }
   
   ngOnInit(){
     
   }
}
<div  [@flyin] ='in'>
  <h4>Home </h4>
  <hr />
  <p>Click an item to remove</p>
  <ul class='items'>
    <li *ngFor="let item of items"  class='pointer'
        [@flyItems] ='in' (click)='remove(item)'
       >{{item}}</li>
  </ul>
  
  <div class='row'>
    <div class='col-6'>
      <input type='text' [(ngModel)]='item'
         namee='item' class='form-control form-control-sm' />
    </div>
    <div class='col-6'>
      <button type='button' class='btn btn-sm btn-info' (click)='add()'>Add</button>
    </div>
  </div>
</div>
import { Component } from '@angular/core'
import { Component, OnInit } from '@angular/core';
import { trigger, state, style, animate, transition } from '@angular/animations';

import { flyin, flyItems } from './animations'

@Component({
  selector: 'home-comp',
  templateUrl: './src/app/home.component.html',
  animations: [ flyin, flyItems]
})
export class HomeComponent implements OnInit{ 
  
   items: Array<string> = [];
   item:string;
   
   constructor() { }
   
   ngOnInit(){
     this.items.push('New Item 1');
     this.items.push('New Item 2');
     this.items.push('New Item 3');
   }
   
   add(){
     
     if(this.item != null)
      this.items.push(this.item);
      this.item = '';
   }
   remove(text){
     if(text != null){
       var index = this.items.indexOf(text);
       if (index > -1) {
            this.items.splice(index, 1);
       }
     }
   }
}