How to get angular2 to work in eclipse with typescript

后端 未结 5 1149
故里飘歌
故里飘歌 2020-12-28 09:37

So I was starting researching about angular2 and since I saw so many references to typescript being prefered I am trying to switch to it from javascript. Problem is, I saw a

5条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-28 10:06

    What I did was:

    1- Install Eclipse Mars, other guys uses older versions

    2- Install Node.js

    3- Install WildFly Server

    4- Install TypeScript plugin https://marketplace.eclipse.org/content/typescript

    5- Import my project in eclipse, you may have to create a new static web project and add your files in there. The 5 minute quick start is not an eclipse web project so you may not be able to import this. Do not forget to copy and past the same structure with the node modules that you have

    6- Right click on the project > Configure > Enable Typescript Builder

    7- Right Click the project > Properties > TypeScript > Compiler and configure as follows:

    I hope this will do it for you.

    Remember, this plugin does not respect json configuration file, so you have to do this manually as in the screenshot. Also, if you are going to provide arguments to your component constructor, You will have errors. Let me know if you got those. Another thing to mention is that using some annotations like @Input will not work, you will have to use inputs:[] inside your @Component annotation.

提交回复
热议问题