ryancp / sailng Goto Github PK
View Code? Open in Web Editor NEWSails.js + Angular = Awesome
License: MIT License
Sails.js + Angular = Awesome
License: MIT License
As a test, I took this repo and removed all your controllers and routes code on the backend and changed the blueprint prefix to "/api".
I also added autoWatch: true in the config/blueprint.
In theory I think that should work, and it is halfway working...
Now when I write a message, it comes up in the second window (realtime), but doesn't show in the original window from where it was typed..
I get this error on the server
error: Invalid usage of userpublishAdd(id, alias, idAdded, [socketToOmit])
I found its coming from pubsub line 912.
This is kind of a specific sails problem. Maybe a bug? If someone confirms I will post it on the beta repo
I just installed SailNg and tried the example, but I didn't get far.
When I try to register a new user I get the following message:
{
"status": 500,
"message": "TypeError: Object [object Object] has no method 'done'"
}
You probably know this, but the password character string number is set to minimum 8 yet still creates users and logs them in when password is under 8 characters. Users can post messages, but when they log out they can't log in due to passport not creating the password (cause it's under 8 characters). I would suggest having a check in place that prohibits the creation of users until all criteria is met for account creation. Maybe a beforeCreate method in the model?
mac os 10.10.2 (14C109)
node v0.12.0
Which modules depend on node-XMLHttpRequest? I can directly to download it from the browser.
There are other ways to solve this right?
Whenever I send additional json content other than the message 'title' though $sailsSocket.post, sails tells me I am sending a null object.
I've also written this question on stackoverflow
http://stackoverflow.com/questions/32133579/sailsjs-angularjs-websockets-null-object
i follow (on sails 0.10.5)
$ npm install
$ cd assets
$ bower install
$ cd ../
$ sails lift
load page, html present, no display. any ideas ?
I went through and changed all instances of .done
to .exec
as described in #5.
When running the sailng app and entering messages, the following error appears in the node console, but everything appears to still operate correctly (messages appear on all connected clients).
error: Invalid usage of user
publishAdd(id, alias, isAdded, [socketToOmit])``
Any ideas what this is about?
Hi,
Great project (I assume :) - I'm assuming Sails has made some breaking changes, and I'm not sure how to resolve them.
First,
warn: sails.config.express
is deprecated; use sails.config.http
instead.
I couldn't find sails.config.express anywhere, so I'm not sure where to fix it.
Based on balderdashy/sails#1974, it seems like a problem in config/passport.js but again, it's not obvious what needs to be changed.
In addition, once I got past that point, I opened up the browser, and had more problems.
I was getting a blank page, so I took a look in the console, and found the following errors:
Error: [$location:nobase] $location in HTML5 mode requires a tag to be present!
http://errors.angularjs.org/1.3.0/$location/nobase
at http://localhost:1337/bower_components/angular/angular.js:80:12
at $LocationProvider.$get (http://localhost:1337/bower_components/angular/angular.js:11060:15)
at Object.invoke (http://localhost:1337/bower_components/angular/angular.js:4152:17)
at http://localhost:1337/bower_components/angular/angular.js:3970:37
at getService (http://localhost:1337/bower_components/angular/angular.js:4111:39)
at Object.invoke (http://localhost:1337/bower_components/angular/angular.js:4143:13)
at http://localhost:1337/bower_components/angular/angular.js:3970:37
at getService (http://localhost:1337/bower_components/angular/angular.js:4111:39)
at Object.invoke (http://localhost:1337/bower_components/angular/angular.js:4143:13)
at http://localhost:1337/bower_components/angular/angular.js:3970:37 angular.js:11358
Error: [$compile:ctreq] Controller 'ngInclude', required by directive 'ngInclude', can't be found!
http://errors.angularjs.org/1.3.0/$compile/ctreq?p0=ngInclude&p1=ngInclude
at http://localhost:1337/bower_components/angular/angular.js:80:12
at getControllers (http://localhost:1337/bower_components/angular/angular.js:7447:19)
at nodeLinkFn (http://localhost:1337/bower_components/angular/angular.js:7627:33)
at compositeLinkFn (http://localhost:1337/bower_components/angular/angular.js:6991:13)
at compositeLinkFn (http://localhost:1337/bower_components/angular/angular.js:6994:13)
at nodeLinkFn (http://localhost:1337/bower_components/angular/angular.js:7618:24)
at compositeLinkFn (http://localhost:1337/bower_components/angular/angular.js:6991:13)
at publicLinkFn (http://localhost:1337/bower_components/angular/angular.js:6870:30)
at http://localhost:1337/bower_components/angular/angular.js:1489:27
at Scope.$eval (http://localhost:1337/bower_components/angular/angular.js:14123:28) angular.js:11358(anonymous function) angular.js:11358
Hoping you are still interested in maintaining this project, and can provide insight. I'm happy to offer my help in keeping it updated, once I get more fluent in sails. For now, I'm just a Rails guy trying to get up to speed.
Thx.
The great advantage of the new version, 0.10, is the support to the associations in the models.
Could demonstrate this in your application?
Thank you very much.
thanks for the work.
when login this error always show, even with the username just register, how to fix it?
Hi Ryan,
I'm testing your repository as I'm planning on upgrading my apps to sails 0.10 so I'm putting my app through some test and decided to see how I might apply some your concepts. I'd like to create a few uses with credentials but I'm having some issues.
I register test with your pre-assined password and john with password 123456 but can't use those credentials to login. As I don't see the password begin stored in any format I'm not sure what I can be doing wrong.
The console reports and error after adding a new message "invalid user 'publishAdd(id,alias,idAdded.... error"
When starting the app a flicker display problem occurs.
I tried to use Mongo as the storage but can't get past the login although the messages are stored after I register a new name.
TIA
John
When I do sails lift
(after following the instructions), and I go to http://localhost:1337 I get a blank
page. The source code loads, but no page renders. If I go to http://localhost:1337/something I get the default sails 404. Am I doing something wrong? How can I get the page to load?
I was attempting to upgrade the grunt tasks to include ngAnnotate, IIFE wrapping, and modify the uglification ...
But i cannot fathom how the directory structure is managed ..
I did a grunt wrap task, with expand set, and it ends up in .tmp/public/wrap/.tmp/public/src/** yikes. The next task can't seem to reference it, as all references are somehow redirected.
Could someone provide a little guidance on what/how this is kicked off and how directory redirects work?
Hi,my english is a little.
I Install and run the code, I register a new user and send messages, but when I logout and try to login again with the username and password the app show error 500
Unknown authentication strategy "local"
error: Sending 500 ("Server Error") response:
Error: Unknown authentication strategy "local"
at attempt (c:\nodejs\sailng\node_modules\passport\lib\middleware\authentica
te.js:166:37)
at authenticate (c:\nodejs\sailng\node_modules\passport\lib\middleware\authe
nticate.js:342:7)
at Authenticator.passport.callback (c:\nodejs\sailng\api\services\passport.j
s:250:40)
at Authenticator.bound [as callback](c:nodejssailngnode_modulessailsno
de_moduleslodashdistlodash.js:729:21)
at Object.AuthController.callback (c:\nodejs\sailng\api\controllers\AuthCont
roller.js:121:14)
at bound (c:\nodejs\sailng\node_modules\sails\node_modules\lodash\dist\lodas
h.js:729:21)
at routeTargetFnWrapper (c:\nodejs\sailng\node_modules\sails\lib\router\bind
.js:179:5)
at callbacks (c:\nodejs\sailng\node_modules\sails\node_modules\express\lib\r
outer\index.js:164:37)
at param (c:\nodejs\sailng\node_modules\sails\node_modules\express\lib\route
r\index.js:138:11)
at pass (c:\nodejs\sailng\node_modules\sails\node_modules\express\lib\router
\index.js:145:5)
at nextRoute (c:\nodejs\sailng\node_modules\sails\node_modules\express\lib\r
outer\index.js:100:7)
at callbacks (c:\nodejs\sailng\node_modules\sails\node_modules\express\lib\r
outer\index.js:167:11)
at c:\nodejs\sailng\node_modules\sails\lib\router\bind.js:187:7
at c:\nodejs\sailng\api\policies\passport.js:32:7
at SessionStrategy.strategy.pass (c:\nodejs\sailng\node_modules\passport\lib
\middleware\authenticate.js:318:9)
at SessionStrategy.authenticate (c:\nodejs\sailng\node_modules\passport\lib
strategies\session.js:67:10) [Error: Unknown authentication strategy "local"]
I use Windows 8 and Firefox 36.0.4 for this test
how would one go about testing both the api side and the angular side using your boilerplate?
thanks for the sailng
but my css files are not compile to .tmp/public/styles like i expect
here is my pipeline css part
var cssFilesToInject = [
'styles/my.css',
'styles/**/*.css'
];
but the my .tmp/public/styles/ are still nothing except importer.css , how to fix it ?
Steps to reproduce.
-> Open the site on Chrome mobile, iPhone 5, iOS version 7.1.
-> Exit chrome, return to the homescreen (chrome goes to background)
-> Wait a bit (longer the better)
-> Return to chrome, refresh the page
-> Crash city
This causes a hard crash of the chrome browser and is currently a showstopper for me. I have no idea what is causing it. If anyone could confirm the above that would make me feel way less crazy.
My project is set up in a similar way to yours, I deleted all the CSS, and all the code in my angular controllers. I just have controller definitions and ng-sails is the only thing being required.
After clicking som links I noticed that Register and Login doesn't look like the other "pages". I is missing the header. There is just the form, nothing else. Should it be like that? ...and if I after going to either the Register och Login page, then trying to go back with the back button, well the URL change but nothing else...
Hi Ryan,
Results of further tests
I checked the entire project and can't see why the socket is not working.
I've never used less before and haven't figured how to use the date time (from bootstrap-ui) glyphs. See the message form. Just checking if my fix is the best way as I changed references in
assets/bower_components/angular-bootstrap/ui-bootstrap-tpls.js
from
span class="glyphicon glyphicon-chevron-up"
to
span class="fa a-chevron-up"
Next up is concepts from https://github.com/fnakstad/angular-client-side-auth that use in all my projects and testing with jade templates. My eventual goal is to update https://github.com/johntom/crmMeans which was a couse I gave at the last philly code camp. This repo needs some attention so I figured that the best way to test was to replace this repo with the latest of this awesome stack.
Thanks,
John
Heads up...
debug: Deprecated: `Model.subscribe(socket, null, ...)`
debug: See http://links.sailsjs.org/docs/config/pubsub
debug: (โ + double-click to open link from terminal)
debug: Please use instance rooms instead (or raw sails.sockets.*() methods.)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.