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 Mar 26, 2018. It is now read-only.
Uses grunt-tsd to retrieve an initial set of typescript definitions.
Adds templates for typescript versions of angular items.
Based upon commit 'refs/pull/539/head' of github.com:yeoman/generator-angular
In general, these options can be applied to any generator, though they only affect generators that produce scripts.
190
190
191
-
### CoffeeScript
192
-
For generators that output scripts, the `--coffee` option will output CoffeeScript instead of JavaScript.
191
+
### CoffeeScript and TypeScript
192
+
For generators that output scripts, the `--coffee` option will output CoffeeScript instead of JavaScript, and `--typescript` will output TypeScript instead of JavaScript.
193
193
194
194
For example:
195
195
```bash
@@ -202,9 +202,42 @@ angular.module('myMod')
202
202
.controller'UserCtrl', ($scope) ->
203
203
```
204
204
205
-
A project can mix CoffeScript and JavaScript files.
205
+
For example:
206
+
```bash
207
+
yo angular:controller user --typescript
208
+
```
209
+
210
+
Produces `app/scripts/controller/user.ts`:
211
+
```typescript
212
+
/// <referencepath="../app.ts" />
213
+
214
+
'use strict';
215
+
216
+
moduledemoApp {
217
+
exportinterfaceIUserScopeextendsng.IScope {
218
+
awesomeThings:any[];
219
+
}
220
+
221
+
exportclassUserCtrl {
222
+
223
+
constructor (private$scope:IUserScope) {
224
+
$scope.awesomeThings= [
225
+
'HTML5 Boilerplate',
226
+
'AngularJS',
227
+
'Karma'
228
+
];
229
+
}
230
+
}
231
+
}
232
+
233
+
angular.module('demoApp')
234
+
.controller('UserCtrl', demoApp.UserCtrl);
235
+
```
236
+
237
+
238
+
A project can mix TypeScript, CoffeScript, and JavaScript files.
206
239
207
-
To output JavaScript files, even if CoffeeScript files exist (the default is to output CoffeeScript files if the generator finds any in the project), use `--coffee=false`.
240
+
To output JavaScript files, even if CoffeeScript (or TypeScript) files exist (the default is to output CoffeeScript files if the generator finds any in the project), use `--coffee=false` and/or `--typescript=false`.
0 commit comments