3 ms·
I've found it more straightforward to transition to Angular over from a more server-side setup gradually. The template language is at least in the same general
by rtpg 10y ago
I've found it more straightforward to transition to Angular over from a more server-side setup gradually. The template language is at least in the same general area as template languages for Django, Rails, etc.
The general tooling process is pretty simple, no need to convince people of the merits of JSX.
Architecturally speaking many people still like separating presentation from business logic.
Angular has a lot of mature tooling and wrappings around current libraries. Angular also offers a lot more tooling on the side, React is much smaller.
On an architectural side, while React keeps states in components, the state update mechanism is a bit obtuse compared to Angular's "scopes are just objects" philosophy.
It's dependent on how you view things, but if you're working on things where strict component decomposition is hard, and you "like global state in your views", then Angular's state mechanism (controllers) could work better for you.
Some would also declare that the non-turing-complete-ness of the template language in Angular is a feature, not a bug.
- cies 10y agoThanks for this!
- woah 10y agoYou separate your presentation from your business logic in React. What React gives you that Angular doesn't is the ability to separate your presentational logic from your business logic. Angular makes you put presentational logic in with your business logic because presentational logic simply cannot be expressed with the templating format. I would argue that a distinction that you make yourself, based on your application's architecture is more meaningful and useful than one made by some arbitrary separation of source file formats.
- RodericDay 10y agoAll the React stuff is starting to sound a bit to me like "MongoDB is web-scale"
- dev360 10y agoNot really. I think a key distinction is summed up in this quote: "Angular 2 continues to put “JS” into HTML. React puts “HTML” into JS." See: https://medium.freecodecamp.com/angular-2-versus-react-there-will-be-blood-66595faafd51#.1kuf8qlpd https://medium.freecodecamp.com/angular-2-versus-react-there... This influences to some extent what you can do with the frameworks and how your code is organized. I like the fact that since my rendering is essentially JS in React, then I can structure my code better with OO to solve problems (inheritance where appropriate, helper classes, patterns etc). In Angular, its just a awful mess of ng-* statements for flow of control. All you can really do to tame it is to use composition or to mix-in behavior via directives.