Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Building one page apps with angularjs and sails.js backend

I just found out about sails.js and i think it's really awesome. I want to build apps with sails and angular, but i haven't found any guides on doing this. I found this site which is supposed to have a talk on using sails.js instead on express in the mean stack, but there's not video there. I would be glad for links to videos or blog posts on how to do this. Thanks all.

like image 696
SamAko Avatar asked Jan 28 '14 13:01

SamAko


People also ask

Can we create website using AngularJS?

AngularJS, built by Google, is an open-source web application framework that is designed to make both front end development and testing easier for web developers. The main goal of AngularJS is to elongate web applications with MVC (Model–view–controller) capability.

Can I use NodeJS with AngularJS?

Both can be combined to create isomorphic web applications. NodeJS is the cross-platform and a run-time environment for Javascript applications. AngularJS is an open-source platform for web application development which is maintained by Google. In order to use NodeJS, you need to install it into your system.

Can we use Python with Angular?

Angular (TypeScript) is Client side application, which does not allow to run server side programming language like C#, Python.


2 Answers

This is getting downvoted because its not a direct question about code.

I have a boilerplate sailsjs app that you can use to model your own off of..

https://github.com/mikedevita/sailsjs-v10-angularjs-requirejs-boilerplate

This is based on v0.10 which is in beta right now, but the same concept applies.

like image 178
NDBoost Avatar answered Sep 30 '22 02:09

NDBoost


I've created a simple yet powerful angular service, published as a bower component: https://github.com/diegopamio/angular-sails-bind

It basically:

  • Creates the model inside the $scope for you.
  • Retrieves the model data from the backend using socket.
  • Watches for changes made by the user in the UI and updates the backend immediately.
  • Watches for changes made in the backend and updates the UI immediately.

And it does it with just one line of code in your angular app, like this: $sailsBind("", $scope);

I made it as part of a personal project and then I decided to publish it as it could benefit others. It works with sails 0.10. Let me know if it suits your needs or if you'd like to see something else on it.

like image 44
Diego Pamio Avatar answered Sep 30 '22 00:09

Diego Pamio