TypeScript or ES6: what to choose for a beginner in Angular?
Hello everyone! I'm a beginner frontend developer learning Angular. I see that all Angular projects are written in TypeScript, but I already know ES6 (ES2015) pretty well. It seems to me that ES6 already provides arrow functions, classes, modules, promises — basically everything needed for modern development.
For example, here's a simple component in ES6:
```javascript
class UserComponent {
constructor(userService) {
this.userService = userService;
}
getUser(id) {
return this.userService.fetch(id).then(user => {
this.user = user;
this.render();
});
}
render() {
console.log(`User: ${this.user.name}`);
}
}
```
The same code in TypeScript looks more verbose:
```typescript
class UserComponent {
private user: any;
No answers yet.
Log in to leave an answer
Blogs
Swift Application Performance Optimization: Tips and Examples