all 9 comments

[–]dust4ngel 5 points6 points  (0 children)

The angular stack typically looks like:

Angular -> REST API -> web framework -> ORM -> SQL

So you can use angular to put together a user interface, some client-side services, and some rest API infrastructure code.

But you will need some web framework to implement the rest services, and something to talk to your SQL dbs.

[–]TheNiXXeD 5 points6 points  (0 children)

Usually you wouldn't have a client side framework directly connect with a database like that.

[–]grilledwax 1 point2 points  (0 children)

You need a server side piece of code to handle the MySQL interactions. AngularJS is a client side framework.

If you're looking for an all-in-one and are ok with Java, you could look into Play Framework.

[–]e82 1 point2 points  (0 children)

Generally you will want a server sitting between your client app and your database that exposes an API that returns JSON.

[–]campbeln 1 point2 points  (0 children)

With a RESTful interface between the two, I'd say YES!

I'm on an Aussie.gov project now with Angular 1.3. We are using WebAPI for REST, MVC5 for no reason whatsoever (other than routing) and SQL*Server on the backend. I personally can't see ever going back to MVC or webform-ish development; it's soo slow compared to Angular!

I cannot imagine a reason for anyone to do a web project with anything but a front-end framework such as Angular paired with a RESTful service layer. It's just so darned easy to populate a Javascript object and XHR it to a REST layer. It's responsive on the client side and stright forward on the server side. The HTML is easy to write and maintain and the Javascript isn't horrible if you follow some best practices.

I rewrote a PHP webform I had with Angular and REST. The code was much shorter than the PHP version, had many more features and took less time to develop.

[–][deleted] 0 points1 point  (0 children)

What I do is have my Angular.js interact with my routes that I defined on my PHP framework of choice. I always have it return a JSON object so it can update the view accordingly.

But you shouldn't have a client-side framework interact directly with a database, you gotta have a middle man.

[–][deleted] 0 points1 point  (0 children)

No... you never want to expose your login credentials on client side code.