You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 12, 2022. It is now read-only.
The following is the list of modifications made to change the JS project to a TS Project:
2
+
* Moved original README.md to README-JS.md and added this README.md and CONVERSION.md
3
+
* Installed TypeScript typings for angular and related libs `tsd install angular jquery jasmine karma-jasmine angular-mocks angular-protractor selenium-webdriver --save`
4
+
* Added 2 `tsconfig.json` files, one for `app` and another for `e2e-tests`. Two files are needed because of different typings for each.
5
+
* Renamed the `.js` files to `.ts`.
6
+
* As a sample : Converted controller `View1` and `View2`*functions* to *classes* and added a type annotation to use these from tests in a type checked way.
7
+
* Minor modifications of typings needed because of conflict in `jquery` vs. `protractor` : https://github.com/borisyankov/DefinitelyTyped/issues/2734.
8
+
* Remove `$` from `jquery.d.ts` in `e2e-tests`.
9
+
* Remove `protractor` def from `app`.
10
+
11
+
You will notice that stuff like `angular`, `mocks` etc will light up with intellisence and you will get errors if you try to misuse these.
This is based on https://github.com/angular/angular-seed.
2
+
This is based on https://github.com/angular/angular-seed. If you are curious about how the conversion of the JS project was done to the TS project checkout [CONVERSION.md](./CONVERSION.md).
3
3
4
4
## Running
5
5
The following are specific to TypeScript
@@ -9,37 +9,20 @@ Setup TypeScript:
9
9
npm install typescript -g
10
10
npm install tsd -g
11
11
```
12
-
Start the TypeScript compiler in watch mode (either in the `app` folder or in the `e2e-tests` folder) and **leave it running**:
12
+
Start the TypeScript compiler in watch mode (either in the `app` folder or in the `e2e-tests` folder) and **leave it running**:
13
13
14
14
```bash
15
-
tsc --watch --p .
15
+
# For app
16
+
tsc --watch --p app
17
+
# For e2e-tests
18
+
tsc --watch --p e2e-tests
16
19
```
17
20
18
21
That's it. You have typescript setup and ready to go. You can follow the steps of JavaScript ([README-JS](./README-JS.md)) from this point on in a new window starting at the install dependencies section.
19
22
20
23
**TIP**: *Abbriged the remaining JS steps for a quick start:*
21
24
```bash
22
-
npm install
25
+
npm install
23
26
npm start
24
27
```
25
28
and visit : http://localhost:8000/app/
26
-
27
-
## Upgrading
28
-
The following is the list of modifications made to change the JS project to a TS Project:
29
-
* Moved original README.md to README-JS.md and added this README.md
30
-
* Installed TypeScript typings for angular and related libs `tsd install angular jquery jasmine karma-jasmine angular-mocks angular-protractor selenium-webdriver --save`
31
-
* Added 2 `tsconfig.json` files, one for main and another for tests with contents:
32
-
```json
33
-
{
34
-
"files": [
35
-
list of files
36
-
]
37
-
}
38
-
```
39
-
* Renamed the `.js` files to `.ts`.
40
-
* As a sample : Converted controller `View1` and `View2`*functions* to *classes* and added a type annotation to use these from tests in a type checked way.
41
-
* Minor modifications of definitions needed because of conflict in `jquery` vs. `protractor` : https://github.com/borisyankov/DefinitelyTyped/issues/2734.
42
-
* Remove `$` from `jquery.d.ts` in `e2e-tests`.
43
-
* Remove `protractor` def from `app`.
44
-
45
-
You will notice that stuff like `angular`, `mocks` etc will light up with intellisence and you will get errors if you try to misuse these.
0 commit comments