TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Angular 2 docs for ES6/7

45 点作者 valera_rozuvan超过 8 年前

15 条评论

DigitalSea超过 8 年前
It&#x27;s the attitude of the Angular 2 team that makes me glad I decided to choose Aurelia instead. Nobody seems to realise that Angular 2 exists first and foremost to meet the needs of Google&#x27;s internal Green Tea team and not the public.<p>This is just one of many things that should make people think twice about using Angular 2. The fact the team seemingly take input from a select handful of &quot;Google experts&quot; to guide the framework should be an alarm bell in itself. NG2 is a monolithic and over-engineered framework backed by a company who have proven they conflict with themselves (Polymer) and deprecate popular services on a whim (Google Reader).<p>I personally use TypeScript in my Aurelia applications, but I think you should allow developers to write using straight-up Javascript. We&#x27;re getting to the point (or if you&#x27;re writing evergreen focused web applications, you&#x27;re there now) where we will be able to write Javascript without a transpiler soon (for most things).<p>I love TypeScript, but we can&#x27;t forget what it&#x27;s a subset of and some have the view that Javascript doesn&#x27;t need types or interfaces.
评论 #12815280 未加载
评论 #12815025 未加载
评论 #12815171 未加载
评论 #12815084 未加载
评论 #12815190 未加载
评论 #12815267 未加载
评论 #12815446 未加载
anupshinde超过 8 年前
After switching to TypeScript, I am not sure whether I will ever go back to JavaScript (after so many years of using JS). I don&#x27;t use or like Angular2 - but I use React with TypeScript.<p>Even if we could use ES6 JavaScript in the browser, transpilation isn&#x27;t going away completely because we need HTML, uglification, vendor-libs, etc to be brought in together before deploying to production.<p>WARNING: If you are starting off with React+Typescript, expect to bang your head for may be, a couple of days, to get that stuff working. However, once it does work, it saves much more time and effort
评论 #12815269 未加载
评论 #12815257 未加载
SamUK96超过 8 年前
I&#x27;ve been learning AngularJS 2 for around 2 weeks now, and I see why they push use of Typescript. They always have. AngularJS 2 was <i>designed</i> from the start to be typed. To be object-orientated. At the least be object-inspired. It makes sense to be consistent. Using a non-typed and functional-structured language for a typed and object-orientated framework is pretty dumb in my eyes.<p>To digress a little, AngularJS 2 has been awesome, and at times can be simpler than React. The .js and .js.map file bulk with every .ts file is stupid though.<p>However...<p>Routing in AngularJS 2.<p>It is bad.<p>Very bad.
评论 #12814906 未加载
评论 #12815418 未加载
评论 #12814872 未加载
ungzd超过 8 年前
Another sign that it&#x27;s designed for enterprise Java camp: old Angular was very popular in such shops because of IoC and service factories. Now it requires java-like language on top of javascript, with type system designed primarily for autocomplete in IDE to work (even unlike Java in which type system is primarily intended to make runtime do less computations).
评论 #12814972 未加载
评论 #12814884 未加载
stpapa超过 8 年前
I don&#x27;t see a problem here, we&#x27;ve know Typescript is core here from the beginning.
评论 #12814631 未加载
nmdanny超过 8 年前
Typescript is a superset of ES6 anyway, proper JS documentation(e.g MDN) does have the notion of types anyway, but basing the documentation on TS means that the types are sound and consistent along the library.
评论 #12815672 未加载
chad-autry超过 8 年前
To me, many of the comments seem to have it backwards.<p>ES6 is a superset for ES5, so given the ES5 docs you can write NG2 apps with ES6.<p>Typescript being a superset of ES6 means it would be a struggle to write an NG2 app in ES5 or ES6 given only the Typescript documentation. I tried during beta, it was an exercise in frustration that I finally abandoned.<p>Providing documentation for the lowest common denominator of ES5 should let you write in ES6 (heck, it should let you write in Typescript if you realyl wanted to!) But some of the dev&#x27;s comments are a bit backwards IMO when they say use Typescript documentation for ES6.<p>You can see my beta NG2+vailla JS project here <a href="https:&#x2F;&#x2F;github.com&#x2F;chad-autry&#x2F;ng2bp" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;chad-autry&#x2F;ng2bp</a>
valera_rozuvan超过 8 年前
For those of you who are saying that TypeScript is a superset of ES6. Stop! ES6 does not have decorators. See <a href="https:&#x2F;&#x2F;github.com&#x2F;tc39&#x2F;proposal-decorators" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;tc39&#x2F;proposal-decorators</a> .<p>Almost all Angular2 projects, that claim to be using ES6, are in fact using ES6 + Babel Legacy Decorator plugin <a href="https:&#x2F;&#x2F;github.com&#x2F;loganfsmyth&#x2F;babel-plugin-transform-decorators-legacy" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;loganfsmyth&#x2F;babel-plugin-transform-decora...</a> . The legacy plugin adds syntactic sugar on top of ES6. This is no better than TypeScript in the first place.
douche超过 8 年前
I say good. One of the next tasks I&#x27;m going to take, as soon as I get some free time, is to integrate TypeScript into our front-end and start adding in interfaces and parameter types. I&#x27;m usually working on the back-end, but get drafted into the UI-side once in a while. The number of stupid little errors caused by typos or not having decent intellisense is troubling. Compared to the level of tooling and safety I&#x27;m used to on the back-end, it feels like banging rocks together.<p>Especially when we&#x27;ve got a gulp build process that takes long enough to run that I want to start some XKCD chair-jousting matches between edits.
评论 #12814727 未加载
评论 #12814738 未加载
robwormald超过 8 年前
Angular core team member here, let me see if I can clarify some of our decisions here:<p>It&#x27;s not a secret that we promote Typescript as the first choice for Angular2 - this is a conscious decision based on both technical reasoning as well as feedback from our developer community.<p>I can count on one hand the number of teams I&#x27;ve spoken to who really want to use ES6 - the vast majority are happy using Typescript.<p>Typescript also allows us to do the kind of static analysis we use to do ahead-of-time template compilation, something that is significantly more difficult with ES5&#x2F;6 - we&#x27;ve discussed making this work in the future, but for now it&#x27;s a lot of engineering investment for something there just isn&#x27;t the demand for.<p>A couple of other things I want to mention - &quot;enterprise&quot; gets thrown around on HN sometimes as a bit of a dirty word. We don&#x27;t see it like that at all - the vast majority of Angular 1 users are exactly enterprise, and we&#x27;re solving for the problems that large teams like them run into.<p>Now we&#x27;re released and stable, I think it&#x27;s a reasonable ask to add some specific docs on ES6 usage (or at least where it differs from TS), I&#x27;ll bring it up at the next docs meeting.<p>Anecdotally, my experience talking to outside teams tells me that TS is not the complexity problem people have - the vast majority of devs coming from ES5-land have trouble with ES modules and bundling, rather than the specifics of ES&#x2F;TS itself - this is part of the reason we&#x27;re working hard on the angular-CLI.<p>As far as Google&#x2F;Angular&#x27;s commitment to the outside world - we have a Developer Relations team (of which I&#x27;m at member) - our only job is making non-Google developers successful with Angular. Feel free to reach out to me (@robwormald) or @stephenfluin if you&#x27;ve got questions or concerns. We both come from &quot;enterprise&quot; webdev and a big part of our job is making sure outside developers are represented in eng-team decision making.<p>Also reach out if this is something you care about deeply and want to contribute to the documentation - we&#x27;d love your help and I&#x27;ll put you in touch with the right people.
49531超过 8 年前
I wonder why; it seems weird to insist your users either use TypeScript or mentally translate it to es6. I would think allowing community members to write es6 docs would be a good way to get more involvement. ¯\_(ツ)_&#x2F;¯
valera_rozuvan超过 8 年前
I am a strong believer in Angular (1 &amp; 2) and in JavaScript. I am using Ng1 &amp; Ng2 on production. I even have a seed project for Ng2 that uses pure ES6 (no legacy Babel plugins). See <a href="https:&#x2F;&#x2F;github.com&#x2F;valera-rozuvan&#x2F;angular2-es6-seed" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;valera-rozuvan&#x2F;angular2-es6-seed</a> .<p>I know how much it hurts when you can&#x27;t find decent documentation for Ng2 with ES6.
aichi超过 8 年前
ES6 is next version of ES5 so whatever works for ES5 should work for ES6, no need for special DOC for that.
评论 #12815218 未加载
squeral超过 8 年前
It&#x27;s not a big deal. If you&#x27;re using ES6 then TypeScript should be straightforward.
bricss超过 8 年前
That&#x27;s duck<i>
评论 #12815691 未加载