<!DOCTYPE html>
<html>

  <head>
    <title>angular2 playground</title>
    <link rel="stylesheet" href="style.css" />
    <script src="https://code.angularjs.org/2.0.0-beta.17/angular2-polyfills.js"></script>
    <script src="https://code.angularjs.org/tools/system.js"></script>
    <script src="https://code.angularjs.org/tools/typescript.js"></script>
    <script src="config.js"></script>
    <script src="https://code.angularjs.org/2.0.0-beta.17/Rx.js"></script>
    <script src="https://code.angularjs.org/2.0.0-beta.17/angular2.min.js"></script>
    <script src="https://code.angularjs.org/2.0.0-beta.17/router.min.js"></script>
    <script src="https://code.angularjs.org/2.0.0-beta.17/http.min.js"></script>

    <script>
    System.import('app')
      .catch(console.error.bind(console));
  </script>
  </head>
<base href=".">
  <body>
    <my-app>
    loading...
  </my-app>
  </body>

</html>
/* Styles go here */

### Angular2 Starter Plunker - Typescript - RC.0

A simple plunker demonstrating Angular2 usage:
- Uses SystemJS + TypeScript to compile on the fly
- Includes binding, directives, http, pipes, and DI usage.
System.config({
  //use typescript for compilation
  transpiler: 'typescript',
  //typescript compiler options
  typescriptOptions: {
    emitDecoratorMetadata: true
  },
  //map tells the System loader where to look for things
  map: {
    app: "./src",
    '@angular': 'https://npmcdn.com/@angular',
    'rxjs': 'https://npmcdn.com/rxjs@5.0.0-beta.6'
  },
  //packages defines our app package
  packages: {
    app: {
      main: './main.ts',
      defaultExtension: 'ts'
    },
    '@angular/core': {
      main: 'core.umd.js',
      defaultExtension: 'js'
    },
    '@angular/compiler': {
      main: 'compiler.umd.js',
      defaultExtension: 'js'
    },
    '@angular/common': {
      main: 'common.umd.js',
      defaultExtension: 'js'
    },
    '@angular/platform-browser-dynamic': {
      main: 'platform-browser-dynamic.umd.js',
      defaultExtension: 'js'
    },
    '@angular/platform-browser': {
      main: 'platform-browser.umd.js',
      defaultExtension: 'js'
    },
    rxjs: {
      defaultExtension: 'js'
    }
  }
});
//main entry point
import {bootstrap} from 'angular2/platform/browser';
import {provide, bind} from 'angular2/core';
import {ROUTER_PROVIDERS, ROUTER_BINDINGS} from 'angular2/router';

import {App} from './app';

bootstrap(App, [
  ROUTER_PROVIDERS
]);
//our root app component
import {Component} from 'angular2/core'
import {RouteConfig, Router, Route,  ROUTER_DIRECTIVES} from 'angular2/router';
import {Login} from './login';
import {Layout} from './layout';


@Component({
  selector: 'my-app',
  template: `
    <router-outlet></router-outlet>
  `,
  directives: [ROUTER_DIRECTIVES]
})
@RouteConfig([
   new Route({path: '/...', name: 'Layout', component: Layout}),
   new Route({path: '/login', name: 'Login', component: Login}),
  {path: '/**', redirectTo: ['Layout']}
])
export class App {
  constructor(public router: Router) {
    this.name = 'Angular2 (Release Candidate!)'
  }
}
import {Component} from 'angular2/core'
import {RouteConfig, Router, Route,  ROUTER_DIRECTIVES} from 'angular2/router';

@Component({
  selector: 'dashboard',
	template: `
	  <div style="color:red">dashboard!!!:</div>	`
})

export class Dashboard {
  constructor(public router: Router) {
 
  }
}
import {Component} from 'angular2/core'
import {RouteConfig, Router, Route,  ROUTER_DIRECTIVES} from 'angular2/router';
import {Dashboard} from './dashboard';
import {Reports} from './reports';
@Component({
  selector: 'layout',
	template: `
    <h2>Hello {{name}}</h2>
    <a [routerLink]="['Layout']">Dashboard</a> | 
    <a [routerLink]="['Reports']">Reports</a> |
    <a [routerLink]="['Login']">Login</a>
    <hr>
	  <router-outlet></router-outlet> `,
  directives: [ROUTER_DIRECTIVES]
})
@RouteConfig([
   new Route({path: '/', name: 'Dashboard', component: Dashboard, useAsDefault:true}),
   new Route({path: '/reports', name: 'Reports', component: Reports})
])
export class Layout { 
  constructor(public router: Router) {
   // alert()
  }
}
import {Component} from 'angular2/core'
import {RouteConfig, Router, Route,  ROUTER_DIRECTIVES} from 'angular2/router';

@Component({
  selector: 'login',
	template: `
	  <div>
	    <h1>Please Log In</h1>
	    <div style="text-align:center">
	          username:<input> 
	    </div>
	    <div style="text-align:center">
           password:<input> 
	    </div>
	    <div style="text-align:center">
	     <button (click)="login()">login</button>
	   </div>
	  </div>	`
})

export class Login {
  constructor(public router: Router){}
  login(){
    this.router.navigate(['Layout']);
  }
}
import {Component} from 'angular2/core'
@Component({
  selector:'reports',
	template: `
	  <div>reports:</div>
	  <div>
	    <table style="border:1px solid red">
	      <thead>
	        <tr>
	         <th>
	          column1
	         </th>
	         <th>
	          column2
	         </th>
	         </tr>
	       </thead>
	       <tbody>
	         <tr>
	           <td>2134
	           </td>
	           <td>4556
	           </td>
	         </tr>
	         <tr>
	           <td>0034
	           </td>
	           <td>4577
	           </td>
	         </tr>
	         <tr>
	           <td>888
	           </td>
	           <td>7869
	           </td>
	         </tr>
	         <tr>
	           <td>2134
	           </td>
	           <td>4556
	           </td>
	         </tr>	         
	       </tbody>
	    </table>
	  
	  
	  
	  
	  </div>
	`
})

export class Reports {
}