GithubHelp home page GithubHelp logo

typescript-notes's Introduction

Essential system setup:

  1. Visual Studio Code
  2. Nodejs runtime (LTS is preferred)
  3. Angular CLI

How to install Angular CLI? after you have installed nodejs, ensure these commands are working

node --version

npm --version

If not, please check your environment variables. Chances are your shell cannot locate the executables.

Once you are done, run this command

npm i -g @angular/cli

Mac/Linux users use:

sudo npm i -g @angular/cli

i is the shortcut for install and -g for global (intended for tools like typescript, angular, etc).

After this, install typescript by this command

npm i -g typescript // sudo for mac/Linux

For creating a typescript project, create a directory and change to it. Run this command for using npm for this project:

npm init --yes

This creates the package.json file.

Then:

tsc --init

This creates tsconfig.json which is used for compiler configuration for typescript compiler. Go to this file and change target to "es2017" for advanced features.

To transpile the ts files to js, use tsc inside the directory. This creates a js file for every ts file. Run the .js file with node (node x.js). Don't forget to transpile after you make a change to ts file.


To create an app in angular, use:

ng new app-name // names are separated by dashes. no digit immediately after dash.

At this point, do not select router and use default CSS for style.

typescript-notes's People

Contributors

vivek-training avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.