Skip to content

Commit

Permalink
Successfully upgraded to angular 2 RC1
Browse files Browse the repository at this point in the history
  • Loading branch information
Sharpiro committed May 25, 2016
1 parent 32a11aa commit 7ed661a
Show file tree
Hide file tree
Showing 20 changed files with 87 additions and 87 deletions.
70 changes: 40 additions & 30 deletions InterviewPrep.Angular2FirstLook/package.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,42 @@
{
"name": "angular2-quickstart",
"version": "1.0.0",
"scripts": {
"start": "tsc && 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.17",
"es6-shim": "^0.35.0",
"reflect-metadata": "0.1.2",
"rxjs": "5.0.0-beta.2",
"zone.js": "0.6.12",
"systemjs": "0.19.26",
"a2-in-memory-web-api": "0.1.15",
"jquery": "^2.2.3",
"toastr": "2.1.2",
"bootstrap": "^3.3.6",
"material-design-lite": "^1.1.3"
},
"devDependencies": {
"concurrently": "^2.0.0",
"lite-server": "^2.2.0",
"typescript": "^1.8.10",
"typings": "^0.8.1"
}
"name": "angular2-quickstart",
"version": "1.0.0",
"scripts": {
"start": "tsc && 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": {
"@angular/common": "2.0.0-rc.1",
"@angular/compiler": "2.0.0-rc.1",
"@angular/core": "2.0.0-rc.1",
"@angular/http": "2.0.0-rc.1",
"@angular/platform-browser": "2.0.0-rc.1",
"@angular/platform-browser-dynamic": "2.0.0-rc.1",
"@angular/router": "2.0.0-rc.1",
"@angular/router-deprecated": "2.0.0-rc.1",
"@angular/upgrade": "2.0.0-rc.1",

"systemjs": "0.19.27",
"core-js": "^2.4.0",
"reflect-metadata": "^0.1.3",
"rxjs": "5.0.0-beta.6",
"zone.js": "^0.6.12",

"angular2-in-memory-web-api": "0.0.9",
"bootstrap": "^3.3.6",
"jquery": "^2.2.3",
"toastr": "2.1.2",
"material-design-lite": "^1.1.3"
},
"devDependencies": {
"concurrently": "^2.0.0",
"lite-server": "^2.2.0",
"typescript": "^1.8.10",
"typings": "^0.8.1"
}
}
5 changes: 2 additions & 3 deletions InterviewPrep.Angular2FirstLook/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@
"compileOnSave": true,
"compilerOptions": {
"target": "es5",
"module": "system",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": true,
"noImplicitAny": true,
"noEmitOnError": true
"noImplicitAny": true
},
"exclude": [
"node_modules",
Expand Down
6 changes: 4 additions & 2 deletions InterviewPrep.Angular2FirstLook/typings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"ambientDependencies": {
"es6-shim": "github:DefinitelyTyped/DefinitelyTyped/es6-shim/es6-shim.d.ts#7de6c3dd94feaeb21f20054b9f30d5dabc5efabd",
"jasmine": "github:DefinitelyTyped/DefinitelyTyped/jasmine/jasmine.d.ts#5c182b9af717f73146399c2485f70f1e2ac0ff2b",
"core-js": "registry:dt/core-js#0.0.0+20160317120654",
"jasmine": "registry:dt/jasmine#2.2.0+20160412134438",
"node": "registry:dt/node#4.0.0+20160509154515",

"jquery": "registry:dt/jquery#1.10.0+20160417213236",
"material-design-lite": "registry:dt/material-design-lite#1.1.3+20160423150231",
"toastr": "registry:dt/toastr#2.0.1+20160316155526"
Expand Down
8 changes: 4 additions & 4 deletions InterviewPrep.Angular2FirstLook/wwwroot/app/appComponent.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {Component, provide, OpaqueToken} from "angular2/core"
import {RouteConfig, ROUTER_DIRECTIVES, ROUTER_PROVIDERS } from "angular2/router"
import {InMemoryBackendService, SEED_DATA} from 'a2-in-memory-web-api/core';
import {Component, provide, OpaqueToken} from "@angular/core"
import {RouteConfig, ROUTER_DIRECTIVES, ROUTER_PROVIDERS } from "@angular/router-deprecated"
import {InMemoryBackendService, SEED_DATA} from "angular2-in-memory-web-api/";
import {InMemoryDb} from "../fakeApi/inMemoryDb"
import {HTTP_PROVIDERS, XHRBackend} from "angular2/http"
import {HTTP_PROVIDERS, XHRBackend} from "@angular/http"
import {DashboardComponent, StaticVehicleService, VehicleService, VehiclesComponent,
VehicleListComponent, VehicleComponent, SpinnerComponent, SpinnerService} from "./appCore"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Pipe, PipeTransform} from "angular2/core"
import {Pipe, PipeTransform} from "@angular/core"

@Pipe({ name: "CustomPipe" })
export class CustomPipe implements PipeTransform
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Component, Output, EventEmitter} from "angular2/core"
import {Component, Output, EventEmitter} from "@angular/core"

@Component({
selector: "filterText",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Injectable} from "angular2/core"
import {Injectable} from "@angular/core"

@Injectable()
export class FilterTextService
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Pipe, PipeTransform} from "angular2/core"
import {Pipe, PipeTransform} from "@angular/core"

@Pipe({ name: "LowerCasePipe" })
export class LowerCasePipe implements PipeTransform
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Component, Input} from "angular2/core"
import {Component, Input} from "@angular/core"

@Component({
selector: "nested",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Component, OnInit, OnDestroy} from "angular2/core"
import {Component, OnInit, OnDestroy} from "@angular/core"
import {Subscription} from "rxjs/Rx"
import {SpinnerService} from "./spinnerService"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Injectable } from "angular2/core";
import { Injectable } from "@angular/core";
import { Observable, Subject } from "rxjs/Rx";

export interface ISpinnerState
Expand All @@ -15,7 +15,7 @@ export class SpinnerService

constructor()
{
this._spinnerSubject = new Subject();
this._spinnerSubject = new Subject<ISpinnerState>();
this.spinnerState = this._spinnerSubject.asObservable();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Component, OnInit, Inject, EventEmitter, Output, AfterViewInit, ChangeDetectorRef} from "angular2/core"
import {Component, OnInit, Inject, EventEmitter, Output, AfterViewInit, ChangeDetectorRef} from "@angular/core"
import {Observable} from "rxjs/Rx"
import {IVehicleService} from "../vehicles/vehicles"
import {CustomPipe, NestedComponent, LowerCasePipe} from "../blocks/blocks"
Expand Down
9 changes: 5 additions & 4 deletions InterviewPrep.Angular2FirstLook/wwwroot/app/main.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import {bootstrap} from "angular2/platform/browser";
import {provide} from "angular2/core"
import {bootstrap} from "@angular/platform-browser-dynamic";
import {provide} from "@angular/core"
import {AppComponent} from "./appComponent";
import {ROUTER_PROVIDERS} from "angular2/router"
import {LocationStrategy, HashLocationStrategy, APP_BASE_HREF, PathLocationStrategy} from "angular2/platform/common"
import {ROUTER_PROVIDERS} from "@angular/router-deprecated"
import {LocationStrategy, HashLocationStrategy, APP_BASE_HREF, PathLocationStrategy} from "@angular/common"
import "rxjs/Rx"

bootstrap(AppComponent, [ROUTER_PROVIDERS, provide(APP_BASE_HREF, { useValue: '/' }),
provide(LocationStrategy, { useClass: HashLocationStrategy })]);
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Observable} from "rxjs/Rx"
import {OpaqueToken} from "angular2/core"
import {OpaqueToken} from "@angular/core"

export interface IVehicleService
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Component} from "angular2/core"
import {RouteConfig, ROUTER_DIRECTIVES} from "angular2/router"
import {Component} from "@angular/core"
import {RouteConfig, ROUTER_DIRECTIVES} from "@angular/router-deprecated"
import {VehicleComponent, VehicleListComponent} from "./vehicles"

@Component({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Injectable} from 'angular2/core';
import {Http, Response} from 'angular2/http';
import {Injectable} from '@angular/core';
import {Http, Response} from '@angular/http';
import {Observable, Operator} from "rxjs/Rx"
import {IVehicleService} from "./vehicles"
import {SpinnerService} from "../blocks/blocks"
Expand All @@ -13,10 +13,10 @@ export class StaticVehicleService implements IVehicleService
{
this._spinnerService.show();
var promise = this.httpService.get("/api/vehicles")
.map((response: Response) => <IBaseData[]>(response.json().data))
.do(data => console.log())
.catch(this.handleError)
.finally(() => this._spinnerService.hide());
.finally(() => this._spinnerService.hide())
.map((response: Response) => <IBaseData[]>(response.json().data))

//var promise = Observable.create((observer: any) =>
//{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Component, Inject, OnInit, Input} from "angular2/core"
import {RouteParams, Router} from "angular2/router"
import {Component, Inject, OnInit, Input} from "@angular/core"
import {RouteParams, Router} from "@angular/router-deprecated"
import {IVehicleService } from "./vehicles"

@Component({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Component, OnInit, AfterViewInit, Inject, EventEmitter, Output, ViewChild, ChangeDetectorRef} from "angular2/core"
import {ROUTER_DIRECTIVES, RouteConfig} from "angular2/router"
import {Component, OnInit, AfterViewInit, Inject, EventEmitter, Output, ViewChild, ChangeDetectorRef} from "@angular/core"
import {ROUTER_DIRECTIVES, RouteConfig} from "@angular/router-deprecated"
import {Observable} from "rxjs/rx"
import {IVehicleService, VehicleComponent } from "./vehicles"
import {NestedComponent, CustomPipe, FilterTextService, FilterTextComponent, LowerCasePipe} from "../blocks/blocks"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Injectable} from "angular2/core"
import {Http} from "angular2/http"
import {Injectable} from "@angular/core"
import {Http} from "@angular/http"
import {Observable} from "rxjs/Rx"
import {IVehicleService} from "./vehicles"

Expand Down
32 changes: 10 additions & 22 deletions InterviewPrep.Angular2FirstLook/wwwroot/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,41 +3,29 @@
<title>Angular 2 First Look</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<!--<base href="/">-->
<!-- 1. Load libraries -->
<!-- IE required polyfills, in this exact order -->
<link rel="stylesheet" href="node_modules/toastr/build/toastr.css" />
<link rel="stylesheet" href="node_modules/bootstrap/dist/css/bootstrap.min.css" />

<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>
<script src="node_modules/angular2/bundles/http.dev.js"></script>
<script src="node_modules/a2-in-memory-web-api/web-api.js"></script>
<script src="node_modules/jquery/dist/jquery.min.js"></script>
<script src="node_modules/toastr/build/toastr.min.js"></script>
<script src="node_modules/bootstrap/dist/js/bootstrap.min.js"></script>

<!-- MDL-->
<link rel="stylesheet" href="/node_modules/material-design-lite/material.min.css">
<script src="/node_modules/material-design-lite/material.min.js"></script>
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">

<!-- 2. Configure SystemJS -->
<!-- Core -->
<script src="node_modules/zone.js/dist/zone.js"></script>
<script src="node_modules/reflect-metadata/Reflect.js"></script>
<script src="node_modules/systemjs/dist/system.src.js"></script>

<!-- Configure SystemJS -->
<script src="systemjs.config.js"></script>
<script>
System.config({
packages: {
app: { format: 'register', defaultExtension: 'js' },
fakeApi: { format: 'register', defaultExtension: 'js' }
}
});
System.import('app/main')
.then(null, console.error.bind(console));
System.import('app').catch(function (err) { console.error(err); });
</script>

</head>

<!-- 3. Display the application -->
Expand Down

0 comments on commit 7ed661a

Please sign in to comment.