Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Thumbs.db

# Typing TSD #
/src/typings/tsd/
/src/typings/
/typings/
/tsd_typings/

Expand Down
22 changes: 20 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,37 @@ Warning: Angular 2.0 is not production ready yet!

```bash
# clone our repo
git clone https://github.com/angularclass/angular2-webpack-starter.git
git clone https://github.com/ngUpgraders/ng-forward-webpack-starter.git

# change directory to our repo
cd angular2-webpack-starter
cd ng-forward-webpack-starter

# install the repo with npm
npm install

# install types definitions via tsd
tsd install

# start the server
npm start
```
go to [http://localhost:3000](http://localhost:3000) in your browser

> Move from Angular 1 to 2 by changing branch

```bash
# change branch
git checkout angular2

# install angular2 dependencies
npm install

# start the server
npm start
```

go to [http://localhost:3000](http://localhost:3000) in your browser

# Table of Contents
* [File Structure](#file-structure)
* [Getting Started](#getting-started)
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"clean": "rimraf node_modules doc",
"clean-install": "npm run clean && npm install",
"clean-start": "npm run clean && npm start",
"postinstall": "tsd install",
"watch": "webpack --watch",
"server": "webpack-dev-server --inline --colors --display-error-details --display-cached --port 3000",
"express": "node ./examples/server/express-server-example.js",
Expand Down Expand Up @@ -40,6 +41,7 @@
"reflect-metadata": "0.1.2"
},
"devDependencies": {
"chai": "^3.4.1",
"css-loader": "^0.21.0",
"exports-loader": "0.6.2",
"expose-loader": "0.7.0",
Expand Down
2 changes: 0 additions & 2 deletions spec.bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
*/
Error.stackTraceLimit = Infinity;
require('reflect-metadata');
require('angular2/test');
require('angular2/mock');

/*
Ok, this is kinda crazy. We can use the the context method on
Expand Down
30 changes: 20 additions & 10 deletions src/app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,37 @@ import {Component} from 'ng-forward/cjs';
// Every Angular template is first compiled by the browser before Angular runs it's compiler
template: `
<header>
<h1>Hello {{ app.title }}</h1>
<h1>{{app.title}}</h1>
</header>

<main>
Your Content Here
<div>
Todo List

<input type="text" ng-model="title" autofocus>
<div>
<input type="text" ng-keyup="app.addElement($event)" autofocus>
</div>

<pre>this.title = {{ app.title | json }}</pre>
<pre>this.data = {{ app.data | json }}</pre>

<ul>
<li ng-repeat="element in app.list">{{element}}</li>
</ul>
</main>
`
})
export class App {
// These are member type
title: string;
data: Array<any> = []; // default data
list: string[];

constructor() {
this.title = 'ng-forward';
this.title = 'ng-forward with Angular 1.x';
this.list = ['Study', 'Work', 'Party'];
}

addElement($event): void {
$event.preventDefault();

if ($event.keyCode === 13) {
this.list.push($event.target.value);
$event.target.value = '';
}
}
}
5 changes: 0 additions & 5 deletions src/typings/_custom.d.ts

This file was deleted.

4 changes: 0 additions & 4 deletions src/typings/browser.d.ts

This file was deleted.

5 changes: 0 additions & 5 deletions src/typings/webpack.d.ts

This file was deleted.

2 changes: 2 additions & 0 deletions src/vendor.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import '@reactivex/rxjs';
import 'reflect-metadata';
13 changes: 12 additions & 1 deletion test/app/app.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
/// <reference path="../../src/typings/_custom.d.ts" />

/**
* Module dependencies.
*/
import chai = require('chai');

/**
* Globals
*/

var expect = chai.expect;

describe('App', () => {

it('should also be able to test', () => {
expect(true).toBe(true);
expect(true).to.equals(true);
});

});
39 changes: 39 additions & 0 deletions tsd.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"version": "v4",
"repo": "borisyankov/DefinitelyTyped",
"ref": "master",
"path": "src/typings",
"bundle": "src/typings/_custom.d.ts",
"installed": {
"angularjs/angular.d.ts": {
"commit": "c2c22c3b953fe9730d4802022d5e0d18d083909e"
},
"jquery/jquery.d.ts": {
"commit": "c2c22c3b953fe9730d4802022d5e0d18d083909e"
},
"angularjs/angular-mocks.d.ts": {
"commit": "9fb1a5074160e679289b56b99a763104926a4a24"
},
"es6-shim/es6-shim.d.ts": {
"commit": "62eedc3121a5e28c50473d2e4a9cefbcb9c3957f"
},
"angular-ui-router/angular-ui-router.d.ts": {
"commit": "c2c22c3b953fe9730d4802022d5e0d18d083909e"
},
"mocha/mocha.d.ts": {
"commit": "3191f6e0088eee07c4d8fd24e4d27a40a60d9eb9"
},
"sinon/sinon.d.ts": {
"commit": "3191f6e0088eee07c4d8fd24e4d27a40a60d9eb9"
},
"assertion-error/assertion-error.d.ts": {
"commit": "3191f6e0088eee07c4d8fd24e4d27a40a60d9eb9"
},
"chai/chai.d.ts": {
"commit": "3191f6e0088eee07c4d8fd24e4d27a40a60d9eb9"
},
"sinon-chai/sinon-chai.d.ts": {
"commit": "a9ded5b70ede34486731ef6c2e6865f5e9911fc3"
}
}
}
12 changes: 1 addition & 11 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,7 @@ module.exports = {

//
entry: {
'angular2': [
// Angular 2 Deps
'@reactivex/rxjs',
'zone.js',
'reflect-metadata',
// to ensure these modules are grouped together in one file
'angular2/angular2',
'angular2/core',
'angular2/router',
'angular2/http'
],
'angular2': './src/vendor',
'app': [
// App

Expand Down