-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
be73e93
commit 82e9161
Showing
29 changed files
with
181 additions
and
571 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Component } from 'angular2/core'; | ||
import { RouteConfig, ROUTER_DIRECTIVES, ROUTER_PROVIDERS } from 'angular2/router'; | ||
import { VehiclesService } from './vehicles/vehicles.service'; | ||
import { VehiclesListComponent } from "./vehicles/vehicles-list.component"; | ||
|
||
@Component({ | ||
selector: 'vehicles-app', | ||
templateUrl: 'app/app.html', | ||
directives: [ROUTER_DIRECTIVES], | ||
providers: [ROUTER_PROVIDERS, VehiclesService] | ||
}) | ||
@RouteConfig([ | ||
{ | ||
path: '/vehicles', | ||
name: 'VehiclesList', | ||
component: VehiclesListComponent, | ||
useAsDefault: true | ||
} | ||
]) | ||
export class AppComponent { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<h1>Vehicles List</h1> | ||
|
||
<main class="mdl-layout__content"> | ||
<section> | ||
<div class="page-content"> | ||
<router-outlet></router-outlet> | ||
</div> | ||
</section> | ||
</main> | ||
|
||
|
||
<!--<div class="row"> | ||
<div class="col-md-12"> | ||
<vehicles-list [selectedVehicle]="selectedVehicle"></vehicles-list> | ||
</div> | ||
</div>--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { bootstrap } from 'angular2/platform/browser'; | ||
import { AppComponent } from './app.component'; | ||
|
||
bootstrap(AppComponent); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<div class="mdl-grid mdl-card mdl-shadow--4dp" *ngIf="vehicle"> | ||
<div class="mdl-card__media mdl-cell mdl-cell--4-col"> | ||
<img class="article-image" [src]='vehicle.picture' border="0" alt=""> | ||
</div> | ||
<div class="mdl-cell mdl-cell--8-col"> | ||
<h2 class="mdl-card__title-text">{{vehicle.make}} {{vehicle.model}}</h2> | ||
<div class="mdl-card__supporting-text no-left-padding"> | ||
<span>License Plate: {{vehicle.licensePlate}}</span> | ||
<span>Type: {{vehicle.type}}</span> | ||
<span>Seats: {{vehicle.seats}}</span> | ||
<span>Rating: {{vehicle.rating}}</span> | ||
</div> | ||
</div> | ||
</div> |
4 changes: 2 additions & 2 deletions
4
...ponents/vehicle-detail/vehicle-details.ts → ...app/vehicles/vehicle-details.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
17 changes: 7 additions & 10 deletions
17
.../vehicles-list/vehicles-list.component.ts → ...s/app/vehicles/vehicles-list.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.mdl-cell--col-3 { | ||
width: 25%; | ||
} | ||
|
||
.mdl-cell--col-3 img { | ||
width: 100%; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<div class="mdl-grid"> | ||
<div class="mdl-cell mdl-cell--3-col" *ngFor="#vehicle of vehicles" (click)="onSelect(vehicle)"> | ||
<img [src]="vehicle.picture" /> | ||
</div> | ||
</div> | ||
<vehicle-detail [vehicle]="selectedVehicle"></vehicle-detail> |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,48 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<html> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<base href="/" /> | ||
<title>Vehicles Application</title> | ||
<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.css"> | ||
<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap-theme.css"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
|
||
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"> | ||
<link rel="stylesheet" href="https://code.getmdl.io/1.1.2/material.indigo-pink.min.css"> | ||
<script defer src="https://code.getmdl.io/1.1.2/material.min.js"></script> | ||
|
||
<!-- 1. Load libraries --> | ||
<!-- IE required polyfills, in this exact order --> | ||
<script src="node_modules/es6-shim/es6-shim.min.js"></script> | ||
<script src="node_modules/systemjs/dist/system-polyfills.js"></script> | ||
<script src="node_modules/angular2/es6/dev/src/testing/shims_for_IE.js"></script> | ||
|
||
<script src="node_modules/angular2/bundles/angular2-polyfills.js"></script> | ||
<script src="node_modules/systemjs/dist/system.src.js"></script> | ||
<script src="node_modules/rxjs/bundles/Rx.js"></script> | ||
<script src="node_modules/angular2/bundles/angular2.dev.js"></script> | ||
<script src="node_modules/angular2/bundles/router.dev.js"></script> | ||
|
||
<!-- 2. Configure SystemJS --> | ||
<script> | ||
System.config({ | ||
transpiler: 'typescript', | ||
typescriptOptions: { emitDecoratorMetadata: true}, | ||
map: {typescript: 'node_modules/typescript/lib/typescript.js'}, | ||
packages: { | ||
'src' : { | ||
defaultExtension: 'ts' | ||
} | ||
} | ||
}); | ||
System.import('src/components/boot').then(null, console.error.bind(console)); | ||
packages: { | ||
app: { | ||
format: 'register', | ||
defaultExtension: 'js' | ||
} | ||
} | ||
}); | ||
System.import('app/main') | ||
.then(null, console.error.bind(console)); | ||
</script> | ||
</head> | ||
|
||
<!-- 3. Display the application --> | ||
|
||
<body> | ||
<div style="width:70%;margin-left:auto;margin-right:auto;"> | ||
<vehicles-app>Loading...</vehicles-app> | ||
<div> | ||
</body> | ||
</html> | ||
|
||
</html> |
Oops, something went wrong.