V
V
Vitaliy Lavrenko2015-04-04 10:33:17
Angular
Vitaliy Lavrenko, 2015-04-04 10:33:17

How to start developing an application in TypeScript and AndularJS?

Actually, which editor is better to use for auto-completion by type?
With the help of gulp I set up compilation, and with the help of tsd I loaded d.ts files for angular, but PHPStorm does not show all types and still shows an error on d.ts files.
Maybe someone faced such a problem?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2015-04-04
Protko @Fesor

Well let's do it. First you need to try writing applications according to the angular best practice. Then try to start using "classes" and modules, like this:

// ApplicationController.js
export default class ApplicationController {

    constructor(someService) {
         this.someService = someService;
    }

    someMethod() {
        return this.someService.someMethod();
    }
}

// app.js
import ApplicationController from './ApplicationController';

angular
    .module('app', [])
    .controller({
         ApplicationController: ApplicationController
    })
;

Well, then typescript is not a problem.
I have a raw repository where I use such a trick, a gallop build and all that...
https://github.com/fesor/test_suite_manager/tree/m... -you can take a look. But I’ll say right away that it’s worth using only as an example and maybe try to do a little better.
And in principle, replacing ES2015 with TS will not be a problem. + there is a skeleton of Angular2 applications.

V
Vitaliy Lavrenko, 2015-04-04
@VitaliyLavrenko_ua

It is worth mentioning that I have written applications in Angular before, I am interested in setting up the environment and the application skeleton in TypeScript.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question