Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelknoch committed Mar 24, 2016
0 parents commit 9a8e93f
Show file tree
Hide file tree
Showing 23 changed files with 383 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules/
.idea
typings
46 changes: 46 additions & 0 deletions app/LocationComponent/location.component.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions app/LocationComponent/location.component.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions app/LocationComponent/location.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import {Component} from 'angular2/core';
import {RouteParams, Router} from 'angular2/router';

@Component({
template: '<h2>Location</h2>'
})
export class LocationComponent implements OnInit {

location:Location;

constructor(private _router:Router,
private _routeParams:RouteParams) {}

ngOnInit() {
let id = this._routeParams.get('id');
console.info(id);
//this._service.getHero(id).then(hero => this.hero = hero);
}

}
1 change: 1 addition & 0 deletions app/UserComponent/UserComponent.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions app/UserComponent/UserComponent.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 46 additions & 0 deletions app/UserComponent/user.component.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions app/UserComponent/user.component.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions app/UserComponent/user.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import {Component} from 'angular2/core';
import {RouteParams, Router} from 'angular2/router';

@Component({
template: '<h2>Location</h2>'
})

export class UserComponent implements OnInit {

location:Location;

constructor(private _router:Router,
private _routeParams:RouteParams) {
}

ngOnInit() {
let id = this._routeParams.get('id');
console.info(id);
//this._service.getHero(id).then(hero => this.hero = hero);
}

}
51 changes: 51 additions & 0 deletions app/app.component.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions app/app.component.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions app/app.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import {Component} from 'angular2/core';
import {RouteConfig, ROUTER_DIRECTIVES} from 'angular2/router';

import {LocationComponent} from './LocationComponent/location.component';
import {UserComponent} from './UserComponent/user.component';

@Component({
selector: 'dash',
template: '<router-outlet></router-outlet>',
directives: [ROUTER_DIRECTIVES]
})

@RouteConfig([
{path: '/location/:id', name: 'Location', component: LocationComponent},
{path: '/user/:id', name: 'User', component: UserComponent},
])

export class AppComponent {}
23 changes: 23 additions & 0 deletions app/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions app/main.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions app/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import {AppComponent} from './app.component';
import {bootstrap} from 'angular2/platform/browser';
import {ROUTER_PROVIDERS} from 'angular2/router';

bootstrap(AppComponent, [
ROUTER_PROVIDERS
]);
21 changes: 21 additions & 0 deletions app/services/locationService.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions app/services/locationService.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions app/services/locationService.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import {Http, HTTP_PROVIDERS} from 'angular2/http';

export class LocationService {

getLocations() {
http.get("http://locator.in.htwg-konstanz.de:2020/locations/nearby?long=9.169753789901733&lat=47.66868204997508&maxDistance=100000000000&limit=1000000000")
.map(res => res.json())
}

}
41 changes: 41 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<html>
<head>
<!-- Set the base href -->
<base href="/">

<title>Angular 2 QuickStart</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="style/main.css">

<!-- 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({
packages: {
app: {
format: 'register',
defaultExtension: 'js'
}
}
});
System.import('app/main')
.then(null, console.error.bind(console));
</script>
</head>

<!-- 3. Display the application -->
<body>
<dash>Loading...</dash>
</body>
</html>
27 changes: 27 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "angular2-quickstart",
"version": "1.0.0",
"scripts": {
"start": "concurrently \"npm run tsc:w\" \"npm run lite\" ",
"tsc": "tsc",
"tsc:w": "tsc -w",
"lite": "lite-server",
"typings": "typings",
"postinstall": "typings install"
},
"license": "ISC",
"dependencies": {
"angular2": "2.0.0-beta.12",
"systemjs": "0.19.24",
"es6-shim": "^0.35.0",
"reflect-metadata": "0.1.2",
"rxjs": "5.0.0-beta.2",
"zone.js": "0.6.6"
},
"devDependencies": {
"concurrently": "^2.0.0",
"lite-server": "^2.1.0",
"typescript": "^1.8.9",
"typings":"^0.7.9"
}
}
Loading

0 comments on commit 9a8e93f

Please sign in to comment.