3

I've been learning Angular 2 recently, and I must say that this is a great framework if I wanted to build a single-page application.

However, I was wondering how one would integrate angular with a normal, old style websites (say, built on codeigniter) if they only wanted the two way binding functionality?

Of course, I could use angular 2 for that, but with all the routing machinery of angular, it seems rather... out of place. It just seems like I'm trying to use an axe as a hammer.

So, my question is: what would you suggest to someone who wants to build a non single-page website, with old school loading pages, but for the page itself to be very interactive and utilize two way binding? For example, a users list which is a page in itself, but pagination is done via ajax... etc Should I just go with angular2, or maybe another library that's simply more suited for this purpose? Some suggested that ReactJS may just be what I'm looking for.

What do you think?

Auguste
  • 2,007
  • 2
  • 17
  • 25
Northern
  • 113
  • 7
  • Definitely use something else. I'd personally suggest Vue.js. – ceejayoz Jun 13 '16 at 18:22
  • If you add the Angular reference through CDN, you should be able to get all the directives on your website, no matter how old it is. Unfortunately I'm not familiar with codeigniter, I couldn't give you much information. But if you have HTML, you should be able to use all the ng- tags after you add the reference. – Auguste Jun 13 '16 at 18:26
  • From my view: I work on big project - have 40-50 routing states. I don't use Angular 2 (didn't find advantages on battlefield) so I use `Angular 1` with `React` for complicated components. Works fast! BTW our backend is Codeigniter + MongoDB – Maxim Shoustin Jun 13 '16 at 18:26

1 Answers1

1

Although it's true that

client-side routing is just a small piece

of a very large framework, the fact that the structure of a Angular (2) project has exactly 1 index.html file with no server side code, at least implicitly tells us that there's a lot of framework intended for SPAs which a multi-page application may not need.

If what makes Angular 2 a great framework for you is data binding and productivity then have a look at Ember.js. Ember makes it easy to follow best practices rather than spending time on trivial choices.

Community
  • 1
  • 1
T. Webster
  • 9,605
  • 6
  • 67
  • 94
  • 1
    How is Ember better fit for a multi-page application than Angular? Even if that is the case, your answer does very little to explain why Ember is the hammer OP is looking for. – noppa Jun 18 '16 at 15:41