MEAN stack with Sails.js = MongoDB, Sails.js(Express.js), Angular.js 1.5+ and Node.js.
This app is ready to use. Clone this repository git clone https://github.com/kazeidesign/Mean-Sails-Stack.git
in your server.
Run cd Mean-Sails-Stack/ && npm install && sails lift
.
/!\ At the first sails lift
, wait less than one minute for the automatical bower install.
Look in your browser at localhost:1337. Your Sails.js app is ready and you can use Angular.js.
Node.js: version 4.4.4 LTS or later
Sails.js: version 0.12.3 or later
MongoDB: version 2.4.0 or later
Angular.js: version 1.5.5 or later
Grunt-sass: version 1.2.0 or later
Angular-Resource-Sails: version 1.2.2
Angular-Material: version 1.1.0 or later
Html5-boilerplate: version 5.3.0 or later
angular.module('myApp.view1', ['ngRoute', 'sailsResource'])
.config(['$routeProvider', function($routeProvider) {
$routeProvider
.when('/view1', {
templateUrl: 'view1/view1.html',
controller: 'View1Ctrl as task'
});
}])
.controller('View1Ctrl', function ($rootScope, sailsResource) {
var self = this;
var item = sailsResource('Item');
this.itemResource = item;
this.itemForm = new item();
this.itemTypes = item.query();
this.add = function () {
self.itemForm.$save(function (newItem) {
self.itemTypes.push(newItem);
});
self.itemForm = new item();
};
this.cancel = function () {
self.itemForm = new item();
};
this.deleteItem = function (item) {
item.$delete();
};
this.editItem = function (item) {
item.$editing = true;
};
this.saveItem = function (item) {
item.$save();
item.$editing = false;
};
this.checkItemCompleted = function (item){
item.status = "completed";
item.$save();
};
this.checkItemToDo = function (item){
item.status = "To do";
item.$save();
};
this.causeError = function () {
item.notFound(
function (response) {
},
function (response) {
self.error = response.statusCode;
});
};
$rootScope.$on('$sailsResourceCreated', function () {
self.created++;
});
$rootScope.$on('$sailsResourceUpdated', function () {
self.updated++;
});
$rootScope.$on('$sailsResourceDestroyed', function () {
self.destroyed++;
});
})
Means-To-Do: http://kazeidesign.github.io/Means-To-Do/
Angular Sails wraps the native sails.js REST functions. For further information check out the sails docs and Mike's Screencast
The sails service is nothing more like the native socket.io object!
Enjoy!
- Doc
- To do example
- CMS example
- grunt-scss-lint
- grunt-sass-lint
- grunt-postcss