0

Can we use JavaScript for Angular development in place of TypeScript? I am new to Angular development and got this question into my mind. Can someone please answer this.

2 Answers 2

4

Any JavaScript code is valid TypeScript too (as TS is a superset of JS), so it's perfectly possible to just write JavaScript inside .ts files and it should work properly. The only thing that might get in the way is the TypeScript transpiler if it's set to be overly strict about type declarations, but by default it isn't.

Sign up to request clarification or add additional context in comments.

Comments

3

Yes, but Angular 2 is designed around Typescript, and makes heavy use of its annotation processing features, requiring inelegant workarounds if they are not available. I would recommend either using Typescript, as the features it adds to javascript are minimal and non-compulsory, or using another framework designed to be used with pure javascript.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.