-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
node_modules/ | ||
.idea | ||
typings |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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); | ||
} | ||
|
||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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); | ||
} | ||
|
||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 {} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 | ||
]); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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()) | ||
} | ||
|
||
} |
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> |
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" | ||
} | ||
} |