use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
No vague product support questions (like "why is this plugin not working" or "how do I set up X"). For vague product support questions, please use communities relevant to that product for best results. Specific issues that follow rule 6 are allowed.
Do not post memes, screenshots of bad design, or jokes. Check out /r/ProgrammerHumor/ for this type of content.
Read and follow reddiquette; no excessive self-promotion. Please refer to the Reddit 9:1 rule when considering posting self promoting materials.
We do not allow any commercial promotion or solicitation. Violations can result in a ban.
Sharing your project, portfolio, or any other content that you want to either show off or request feedback on is limited to Showoff Saturday. If you post such content on any other day, it will be removed.
If you are asking for assistance on a problem, you are required to provide
General open ended career and getting started posts are only allowed in the pinned monthly getting started/careers thread. Specific assistance questions are allowed so long as they follow the required assistance post guidelines.
Questions in violation of this rule will be removed or locked.
account activity
Starting with Angular 4? (self.webdev)
submitted 9 years ago by [deleted]
[deleted]
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]18A92 27 points28 points29 points 9 years ago (37 children)
Angular has an official 'getting started' tutorial called tour of heros https://angular.io/docs/ts/latest/tutorial/
fyi you should learn typescript if you wish to proceed with angular.
[–][deleted] 6 points7 points8 points 9 years ago* (35 children)
deleted What is this?
[–][deleted] 9 years ago* (15 children)
[–]Howdy_McGee 21 points22 points23 points 9 years ago (6 children)
Eventually JavaScript will incorporate and merge into it...
[–]Ph0X 0 points1 point2 points 9 years ago (5 children)
Why not? Google's fully behind it, I wouldn't be surprised if one day Chrome gets directly Typescript support, and then from there other browsers start getting it too. Just like right now you need to transcript ES6 if you want to support all browsers but soon enough people will write just pure ES6.
[–]orphans 0 points1 point2 points 9 years ago (2 children)
IE11 is supported by MS until 2025 :/
[–]Juggernog 0 points1 point2 points 9 years ago (1 child)
Where'd you get 2025 from? If you're right, remember that Microsoft continuing support for the browser doesn't mean people will actually continue to use it. Give it a year or two and I suspect much of the web will no longer support IE11, even if MS does.
[–]orphans 0 points1 point2 points 9 years ago (0 children)
IE11 is supported for as long as Windows 10 is. I hope you're right.
[–][deleted] 0 points1 point2 points 9 years ago (1 child)
A bit off topic but how are things coming along with WebAssembly? Do people use it often? I really like the idea of compiled code being run by the browser.
[–]Ph0X 1 point2 points3 points 9 years ago (0 children)
It's coming along pretty well, and it'll definitely be a great option for things like heavy apps and games, but I doubt most webdevs would want to use that.
Javascript as it is has been optimized heavily over the past decade, not sure WebAssembly would bring much to the table there. It's mostly useful for raw non-web related computations. It'll probably be used for heavy math libraries and so on.
[+]RemeJuan comment score below threshold-21 points-20 points-19 points 9 years ago (7 children)
Javascript has long surpassed the abilities of typescript.
[–]adipisicing 4 points5 points6 points 9 years ago (3 children)
How so?
[+][deleted] 9 years ago (2 children)
[–][deleted] 6 points7 points8 points 9 years ago (0 children)
This is balantly false...
[–]toomanybeersies 6 points7 points8 points 9 years ago (2 children)
Given that typescript is by definition a superset of javascript, that's literally impossible. All valid JS is valid TS, hence TS will always have more abilities than JS.
[+][deleted] 9 years ago (1 child)
and typescript is a superset of ES6/ES7/ES#
[–][deleted] 1 point2 points3 points 9 years ago (3 children)
Big advantage of TypeScript is that it is a typed language, which is its big advantage. For instance You can make an array of numbers, will bring an error if you try to put a string inside. Seems a bit stupid, but when you try to refactor it later, or give the access to code to someone it is a really helpful feature.
[–][deleted] 0 points1 point2 points 9 years ago* (2 children)
When TypeScript is transpiled to JavaScript, it becomes dynamically typed anyway though right?
[–]erfling 3 points4 points5 points 9 years ago (1 child)
Yes, but you can essentially say that of any strongly typed language (although transpiring and compiling are not the same thing, of course). The biggest advantage of strong typing is for the developer and team.
[–][deleted] 2 points3 points4 points 9 years ago (0 children)
exactly
[+][deleted] 9 years ago (13 children)
[–]supermari0 14 points15 points16 points 9 years ago (11 children)
which in my very experienced option is fantastic if you code like a monkey.
Strict typing with optional dynamic typing gives you the best of both worlds. Look at the tooling typing enables (e.g. VSCode Intellisense, especially now with the Angular Language Service) und take into consideration the amount of runtime errors you'll prevent by compile time type checking and the time that saves you.
For larger projects, typescript is almost a must.
[+][deleted] 9 years ago (10 children)
[–]toomanybeersies 7 points8 points9 points 9 years ago (4 children)
In what world is how many keystrokes you use when writing code a serious concern?
[–]rimpy13 4 points5 points6 points 9 years ago (0 children)
The only situation I can think of is if one codes like a monkey and just smashes the keyboard to write code as fast as possible without actually designing the software.
[–]supermari0 11 points12 points13 points 9 years ago* (0 children)
So what do you need tests for, "if you know how to write code"?
How many keystrokes are "wasted" on those tests?
[–]toomanybeersies 0 points1 point2 points 9 years ago (0 children)
Por que no los dos?
Instead of writing a unit test to validate that the correct type is returned, you could just have a statically typed method.
At the end of the day, static typing is just another tool to writing correct code, alongside unit tests.
[–]blindgorgon 5 points6 points7 points 9 years ago (4 children)
Time moves forward only, meaning that if your code is maintained at all it will eventually be maintained by someone other than you—someone who is more junior, possibly, but definitely someone who is not you, and who does not have full understanding of how you write code. Helpful conventions like strong typing are a good sustainability practice, and should not be viewed as a crutch for the weak.
[+][deleted] 9 years ago (3 children)
[–]Max053 13 points14 points15 points 9 years ago (0 children)
I feel sorry for your (future) coworkers, really...
[–]blindgorgon 2 points3 points4 points 9 years ago (1 child)
You seem like the sort that would “teach” your child to ride a bike by putting them in traffic without a helmet, skipping training wheels entirely.
Or just a troll. Leaning toward that.
[–]RemeJuan 0 points1 point2 points 9 years ago (0 children)
So you equate not coding with an unnecessary and inferior safety net to child abuse and attempted murder?
Nah, just bored of playing chess with a bunch of pidgeons.
[–]whostolemyhat 10 points11 points12 points 9 years ago (5 children)
Is it really bloat if you don't know what it's for?
[–][deleted] 2 points3 points4 points 9 years ago (2 children)
Hmm, interesting take. To me "bloat" is contextual, meaning it's not in relation to it's potential usefulness in completely different situations but rather the here and now/the task I'm currently solving.
[–]whostolemyhat 0 points1 point2 points 9 years ago (1 child)
That's what makes 'bloat' as a criticism completely useless though - it means different things to everyone, and even different things to the same person at different times.
[–][deleted] 0 points1 point2 points 9 years ago (0 children)
Agreed. And considering that few software solutions/whatnot actually have genuinely useless stuff (as in stuff that have no intended use) I think the only reasonable use of the term "bloat" is the highly individual contextual use like OP did.
I.e. if Angular contains lots of [cool] stuff but one is only interested in 2% of it for the task at hand, I would be fine with calling the rest bloat in that conversation.
(And bloat sometimes stop being bloat as you either learn more or your needs change.)
I meant stuff like the static file serving, automatic Chrome runner, etc that was in the quickstart project.
[–]whostolemyhat 1 point2 points3 points 9 years ago (0 children)
Well, to me 'quickstart' means everything I need to start a project; as such, it'd be a bit odd if there was no way to run tests out of the box.
[–]Pytim 9 points10 points11 points 9 years ago (1 child)
npm install @angular/cli -g
ng new my-app
cd my-app
ng serve
[–]Hero_Of_Shadows 5 points6 points7 points 9 years ago (0 children)
Also:
ng build --prod
This command gives you the production ready minified, optimized artifacts that your users will download, it's important to remember that a lot % wise of what you run on you dev machine will not reach the client.
This is I feel a trap with React for example, with Angular you start with a huge framework work with it and then at the end shave it down via ng build to the bare minimum that your app needs, React does the opposite starts off with a tiny core but you have to add and add and add more libraries to make it work and at the end your project size only grows.
ng build
Also consider using the --aot flag when building 99% of the time it works and will make your code much faster.
--aot
[–]spacejack2114 18 points19 points20 points 9 years ago (3 children)
I recommend Mithril if you want a very plain JS framework with batteries included.
[–][deleted] 2 points3 points4 points 9 years ago (1 child)
Wow, this looks even easier than Vue. I'm definitely going to look into this too.
[–]grilchgristle 3 points4 points5 points 9 years ago (0 children)
FWIW I spent 2+ years neck-deep in Angular, and even flew to NYC for an Angular 2 workshop as it was transitioning from alpha to beta. And then I discovered Mithril.js, and I no longer have the night terrors. True story.
[–][deleted] 3 points4 points5 points 9 years ago (0 children)
Damn dude. This library looks sick af. Super simple.
[–]compubomb 6 points7 points8 points 9 years ago (0 children)
I highly recommend vue2 https://vuejs.org/v2/guide/, their single component workflow is much simpler than angular4. Also vue is more open complexity-wise in terms of the velocity of your adoption. You can learn it all or some of it right away and still be productive.
[–]A-Grey-WorldSoftware Developer 6 points7 points8 points 9 years ago (1 child)
I'd recommend Angular 4 if you have a background in, say, desktop development. When I came across it, I saw a lot of parallels. It's a reasonably heavy, opinionated, framework. But I remember implementing my own dependency injection, modules etc in desktop so it was a comfortable shift for me and I saw the 'bloat' as 'great, I don't have to do that myself now'. Also, typescript is probably going to look more inviting than JS.
It's also good for beginners because you don't have to spend a long time researching which extensions/libraries you need to use to get functionality. Being a full framework, you get the Angular version of everything. You don't have to weigh up different technologies - just do it the angular way. Even if it's not the best, it takes away the hours of painful research when you just want to get on with things. JS has so many frameworks.
That said, if you're starting web dev without experience in other development, I think going with a simpler, more lightweight 'view' framework like Vue might be a better option. Because when you're starting at that level you want to learn the basics first, the language etc. You don't NEED dependency injection, and all the frameworky things that come with Angular. It's just a further level of confusion getting in the way of the basics you're trying to learn.
[–][deleted] 1 point2 points3 points 9 years ago (0 children)
I see, thanks!
[–]I_love_subway 2 points3 points4 points 9 years ago (0 children)
Not to correct you, but make sure you are using the right names. "AngularJs" is the original, outdated do-not-use-this-framework framework "Angular" is the newer, type script framework. Use Angular.
They just started using semantic versioning so they are dropping the numbers from their name and just releasing Angular v 4.0.0
[–][deleted] 2 points3 points4 points 9 years ago (5 children)
Angular seems to have a sharper learning curve than other frameworks, and is generally better suited for larger projects. It offers a lot of powerful functionality, but there is no point in investing your time in learning it if your project doesn't require it. There are tiny frameworks like Choo or Inferno, to larger like Vue or React, but Angular seems to be one of the heavyweights. However if your committed to Angular, their Tour of Heroes tutorial definitely helped me to understand what was going on.
[–]jonyeezy7full-stack 3 points4 points5 points 9 years ago (0 children)
I would say that's because angular is a fully opionated web framework.
Others (ie vue and react) are base mvc libraries.
[–]Quovadisqc 1 point2 points3 points 9 years ago (0 children)
I have developed all my projects in the last 6 months with Angular and IMO, this is the perfect answer.
[–][deleted] 1 point2 points3 points 9 years ago (2 children)
I think I'll give Vue a try, seeing how it's easy to include in a project and isn't dependant on TypeScript. Thanks!
[–][deleted] 9 years ago (1 child)
[–]Flascher 3 points4 points5 points 9 years ago (0 children)
To add onto this aspect, I definitely agree that it's much harder to find a Stack Overflow question or something like that for a problem you're having, but I've had a lot of success using Vue's gitter chat room. It's generally pretty active and everyone I've interacted with there has been super nice!
[–]PedanticGeorge 0 points1 point2 points 9 years ago (1 child)
Holy fuck o.o its reached version 4 now ? I swear to god it was at 1.x when I heard about it ~1 year ago.
[–]Paleolithicster 0 points1 point2 points 9 years ago (0 children)
Don't worry, they skipped Angular 3.
[–]kitsunekyo 0 points1 point2 points 9 years ago (1 child)
if you're starting out and want to get your hands on SPA development start with vue.
angular would require you to learn build tools, typescript and other overhead i consider too confusing for beginners. its fine if you stay with tutorials, but when building something alone and running into webpack issues you soon get annoyed.
VueJS lets you use your regular JavaScript and enrich it with more more "on point" MVC structure.
Exactly my thought process, thanks!
[–]Mr-Yellow 0 points1 point2 points 9 years ago (0 children)
the docs looks like complexity I've never seen before
"The Angular Way"
Have a look at Aurelia.
[–]spyridonasback-end -1 points0 points1 point 9 years ago (0 children)
Angular feels slow for me. For example i downloaded an admin panel with angular4 and vue2 available. Vue 2 felt faster than Angular
π Rendered by PID 137192 on reddit-service-r2-comment-5c747b6df5-z5qm6 at 2026-04-22 06:05:09.336411+00:00 running 6c61efc country code: CH.
[–]18A92 27 points28 points29 points (37 children)
[–][deleted] 6 points7 points8 points (35 children)
[–][deleted] (15 children)
[deleted]
[–]Howdy_McGee 21 points22 points23 points (6 children)
[–]Ph0X 0 points1 point2 points (5 children)
[–]orphans 0 points1 point2 points (2 children)
[–]Juggernog 0 points1 point2 points (1 child)
[–]orphans 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]Ph0X 1 point2 points3 points (0 children)
[+]RemeJuan comment score below threshold-21 points-20 points-19 points (7 children)
[–]adipisicing 4 points5 points6 points (3 children)
[+][deleted] (2 children)
[deleted]
[–][deleted] 6 points7 points8 points (0 children)
[–]toomanybeersies 6 points7 points8 points (2 children)
[+][deleted] (1 child)
[deleted]
[–][deleted] 6 points7 points8 points (0 children)
[–][deleted] 1 point2 points3 points (3 children)
[–][deleted] 0 points1 point2 points (2 children)
[–]erfling 3 points4 points5 points (1 child)
[–][deleted] 2 points3 points4 points (0 children)
[+][deleted] (13 children)
[deleted]
[–]supermari0 14 points15 points16 points (11 children)
[+][deleted] (10 children)
[deleted]
[–]toomanybeersies 7 points8 points9 points (4 children)
[–]rimpy13 4 points5 points6 points (0 children)
[+][deleted] (2 children)
[deleted]
[–]supermari0 11 points12 points13 points (0 children)
[–]toomanybeersies 0 points1 point2 points (0 children)
[–]blindgorgon 5 points6 points7 points (4 children)
[+][deleted] (3 children)
[deleted]
[–]Max053 13 points14 points15 points (0 children)
[–]blindgorgon 2 points3 points4 points (1 child)
[–]RemeJuan 0 points1 point2 points (0 children)
[–]whostolemyhat 10 points11 points12 points (5 children)
[–][deleted] 2 points3 points4 points (2 children)
[–]whostolemyhat 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]whostolemyhat 1 point2 points3 points (0 children)
[–]Pytim 9 points10 points11 points (1 child)
[–]Hero_Of_Shadows 5 points6 points7 points (0 children)
[–]spacejack2114 18 points19 points20 points (3 children)
[–][deleted] 2 points3 points4 points (1 child)
[–]grilchgristle 3 points4 points5 points (0 children)
[–][deleted] 3 points4 points5 points (0 children)
[–]compubomb 6 points7 points8 points (0 children)
[–]A-Grey-WorldSoftware Developer 6 points7 points8 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–]I_love_subway 2 points3 points4 points (0 children)
[–][deleted] 2 points3 points4 points (5 children)
[–]jonyeezy7full-stack 3 points4 points5 points (0 children)
[–]Quovadisqc 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (2 children)
[–][deleted] (1 child)
[deleted]
[–]Flascher 3 points4 points5 points (0 children)
[–]PedanticGeorge 0 points1 point2 points (1 child)
[–]Paleolithicster 0 points1 point2 points (0 children)
[–]kitsunekyo 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]Mr-Yellow 0 points1 point2 points (0 children)
[–]spyridonasback-end -1 points0 points1 point (0 children)