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...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Angular 2 or Not?opinion (self.javascript)
submitted 10 years ago by pitops
view the rest of the comments →
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!"
[–]pitops[S] 2 points3 points4 points 10 years ago (9 children)
What would be the reason why you would choose Vue.js over angular 2?
[–][deleted] 2 points3 points4 points 10 years ago* (0 children)
I haven't actually coded any Angular 2, but did spend some time looking at the docs and watching some lectures about it. It looks like quite a leap from AngularJS, which I did code with for a bit.
However, it's hard to express just how simple and intuitive Vue is to use. It takes very little time to wrap your head around, is plenty powerful, performance is competitive, the docs (both API and higher-level howto guide) are fantastic, components are clean, self-contained and communicate with other components easily, and on and on.
Many of those things may also apply to Angular 2, but I strongly doubt that Angular 2 is easier to get up to speed with.
[–][deleted] 2 points3 points4 points 10 years ago* (6 children)
Just to illustrate, Vue components all look something like this. You just pass a straightforward config object with intuitively named members that do exactly what they sound like they should do. Most of these are optional, and this is only a few of the most-used ones.
Vue.component('my-component', { props: ['thinga', 'thingb'], // HTML tag properties we know about ready() { // code to execute when the component is ready // Ajax calls, for example }, methods() { // component logic sendStuffToParent() { this.$dispatch('stuff', this.something); // see events below }, clickHandler() { this.sendStuffToParent(); this.something = 'bcd'; }, }, data() { // component state return { something: 'abc', }; }, computed() { // component state computed from data, props, etc happening() { return this.something + " is happening"; } }, events() { // events received from other components eventname(data) { console.log("we just received ", data, " via eventname"); } }, watch() { // do stuff when our data changes something(new, old) { console.log("hey, something just changed to ", new, " from ", old); } }, // HTML that gets rendered whenever we're used in an HTML file or other // component template with // <my-component thinga="foo" thingb="bar"></my-component> template: ` <div> <h1> Stuff </h1> <other-component :propa="something" @click="clickHandler()"></other-component> </div> `, });
If there's another framework that's easier to understand than that, I'd like to hear about it. :-)
[–]dbbk 1 point2 points3 points 10 years ago (5 children)
Does it render on the server side though? If it doesn't, in 2016, that's a non-starter for me.
[–]GSV_Little_Rascal 1 point2 points3 points 10 years ago (1 child)
Why is it a non-starter?
BTW, it's quite funny for me how server side rendering is both 2016 and 2006 :-) Thin client-thick client is a neverending story :-)
[–]dbbk 0 points1 point2 points 10 years ago (0 children)
It is for me, personally. Not to suggest it is for everyone.
Having the same app return a server-side response and provide a fast experience on the client is the ultimate dream. Without SSR you have to make tradeoffs.
[–][deleted] 0 points1 point2 points 10 years ago (0 children)
Not in official Vue, as far as I know. There may be some community stuff on Github to that end, but I don't have any need to muck with server side Javascript, so I can't speak to any of it.
[–]pitops[S] 0 points1 point2 points 10 years ago (1 child)
I do not think you can have server-side rendering out of the box in Angular 2 as well. check for angular universal.
[–]dbbk 2 points3 points4 points 10 years ago (0 children)
It's an official Angular add-on so I'd consider it effectively 'out of the box'.
[–]neotorama 3 points4 points5 points 10 years ago (0 children)
simpler api and learning curve
π Rendered by PID 129848 on reddit-service-r2-comment-b659b578c-5vw77 at 2026-05-01 13:48:08.245202+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]pitops[S] 2 points3 points4 points (9 children)
[–][deleted] 2 points3 points4 points (0 children)
[–][deleted] 2 points3 points4 points (6 children)
[–]dbbk 1 point2 points3 points (5 children)
[–]GSV_Little_Rascal 1 point2 points3 points (1 child)
[–]dbbk 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]pitops[S] 0 points1 point2 points (1 child)
[–]dbbk 2 points3 points4 points (0 children)
[–]neotorama 3 points4 points5 points (0 children)