Questions tagged [locomotivejs]
Locomotive is a web framework for Node.js. Instilled with familiar MVC patterns and a conventional file layout.
65
questions
0
votes
0
answers
21
views
locomotive JS trigger a script after inizialization
I need to trigger a script after locomotive has been initialize but I can't find a list of event that locomotive it is listening at
scroll.on('init', (args) => {
console.log('init');
});
but ...
2
votes
1
answer
56
views
Why does the scroll only take up half the width of the item? Locomotive scroll
Why do the elements only scroll halfway through and then freeze? In the locomotive scrolling demonstration itself, these elements don't stop, but scroll further. I need the exact same thing. What ...
0
votes
0
answers
47
views
Locomotive JS, does not load the final part of the site
I made a theme for Wordpress, using Swup and Locomotive js.
When I see the theme page, it is half loaded. It doesn't scroll to the footer.
If I refresh the page then I see it perfectly.
I'll give you ...
0
votes
1
answer
926
views
Locomotive scroll issue
I have tag in my website and when click it, needs to move to one of bottom div. It's working fine and website has Locomotive scroll enabled.
The problem
After moving to the bottom section, it cannot ...
0
votes
1
answer
72
views
How can I call a library script after page is loaded?
I'm trying to call a library script (locomotive) in vanilla JS without Jquery, after the whole page and its assets had loaded. I've already tried with something like this:
<body onload="script(...
0
votes
1
answer
1k
views
Horizontal Locomotive scroll not working on mobile
I'm using Locomotive scroll library to animate gallery view horizontaly on scroll.
Problem is mobile view.
See the demo:
DEMO
const lscroll = new LocomotiveScroll({
el: document.querySelector(&...
0
votes
0
answers
209
views
Curtains.js Smooth Scroll Reactjs
I trying ton implement smooth scroll of locomotive-scroll to curtains in Reactjs. But he still doesn't work...
I get errors :
react_curtains__WEBPACK_IMPORTED_MODULE_2__.Curtains.disableDrawing is ...
1
vote
1
answer
809
views
Locomotive Scroll: Is it possible to use querySelector with an URL and an anchor tag?
The links in my navigation use URLs with an anchor-tag (f.e. mysite.com/about#cv). The reason being that i want to jump/scroll to a specific section even if i am not on the f.e. about-page.
Normally ...
0
votes
1
answer
1k
views
scrollTo(target, options) is not working in mobile. (Locomotive scroll)
I am facing a strange issue. On desktop, everything is working fine but when I am switching to mobile some strange things are happening, and don't know why. scrollTo(target, options) is not working at ...
0
votes
1
answer
2k
views
How to get scroll position and document height then run a function and update document height again?
My document height is 11886 and scroll position when I scroll to the bottom of the document is 9542.
I have a function I want to run when I scroll to the bottom of the document that will increase the ...
1
vote
0
answers
148
views
Is it possible to have locomotive.js infinite loop when scrolling down?
I'm wondering if it's possible to make locomotive.js infinite loop to the start of the content when you reach the bottom?
1
vote
1
answer
2k
views
Locomotive Scroll function trigger
Can someone tell me how to trigger a function when the element is in view in locomotive scroll, I am kind of noob, please explain in detail,
Thanks in advance
const counterFunc = () => {
...
0
votes
0
answers
839
views
How to fix locomotive.js uncaught reference error?
I want to use locomotive.js on my project and have installed it on vscode (npm install locomotive-scroll) and have even followed this tutorial:
https://www.youtube.com/watch?v=zrM6N-G6U_M&list=...
1
vote
2
answers
2k
views
Can't scroll down using Barba.js and Locomotive scroll
I'm using barba.js and locomotive scroll together, I have overlay transition which work when I click the menu link (page2) to go to another page, but once that is down I cant scroll down when, I added ...
0
votes
1
answer
972
views
How to display flash message on login with passport ldapauth
So, my app uses a login through a ldap server. Once it's authenticated, I login or create a user on my database, and then proceed with my app.
However, I'm trying to display a flash message when the ...
2
votes
1
answer
90
views
LocomotiveJS - How to access another controller's method
I'm using locomotivejs to build an api and I wanted to know if there was a way to access a controller method from within another controller?
0
votes
1
answer
436
views
How to save a GET response to a variable on ExpressJS and LocomotiveJS
I'm relatively new to NodeJS. I've created an app using ExpressJS and LocomotiveJS framework. How would I save a certain GET response to a variable within a controller.
For example:
file: ...
0
votes
1
answer
218
views
Unable to resolve controller - locomotivejs (nodejs)
I am using nodejs and used the locomotivejs as a MVC Framework..
I am working in my local and when i access the url of users contrell, it will display my data..
However the problem is when i deployed ...
4
votes
1
answer
106
views
model validation on server side in locomotivejs
I want to know if there is a function to check if my model is valid on server side ,I am using locomotivejs on express.
here is my model schema
var BillSchema = new Schema({
BrandId:Schema.Types....
1
vote
1
answer
64
views
How can I set a base template in Locomotive.js?
I don't want to set my assets (CSS/JS, menu, etc) on each view from my project. Is there any way to set a base template and then call views just to fill its body?
Example:
<!-- my base template --...
2
votes
1
answer
4k
views
AngularJS - How to get serverside and clientside routing to work together
Im working on porting a project over to an angular based SPA. Its currently a more "traditional" node/locomotivejs app that serves up templates from the server side (never known the proper term for ...
-2
votes
1
answer
36
views
how do i use coffescript with locomotive JS
Hi i'm trying to use the newest locomotiveJS version but want to use coffescripts for my controllers etc. - Old posts on google (like How do I set coffescript in Locomotivejs?) shows that this is ...
-1
votes
2
answers
274
views
Undefined method flash in the view of node.js
Problem in accessing flash messages on view in node.js
In my Controller
this.req.flash('info','successfully submited');
this.redirect("/home");
In my home view I am not able to get flash messages as
...
0
votes
2
answers
278
views
LocomotiveJS access response JSON in controller's after filter
I'm looking for a way to access the JSON being sent back to the requestor in the "after" filter for a controller.
var locomotive = require('locomotive');
var myController = new locomotive.Controller(...
2
votes
1
answer
229
views
Start locomotive.js 0.4.x for functional testing
The way to start locomotive.js 0.3.x no longer works in 0.4.x, as the signature of app.boot is different. I have:
before(function(done) {
var self = this;
var lcm = new locomotive.Locomotive();
...
0
votes
1
answer
307
views
Routing in locomotive using ejs
I'm trying out node and some frameworks for node atm, specifically locomotive. However, i seem to be stuck on routing using locomotive. A couple questions i can't find the answer to, so here goes:
...
1
vote
1
answer
169
views
Locomotive.js throws error upon calling "locomotive.boot"
I'm trying to write tests on my locomotive.js application, literally copy/pasting code from some examples on the internet. Even so, whenever I run my tests, I get an error saying
TypeError: string is ...
1
vote
1
answer
332
views
Rest API with LocomotiveJs using CORS. Works on local machine but not on Amazon or Heroku
Rest API with LocomotiveJs using CORS. Works on local machine but not on Amazon or Heroku
I did a REST api using LocomotiveJs and now I'm trying to enable CORS on it.
I added the following code to my ...
0
votes
2
answers
238
views
How to add a new url to the routes.js file in an already existing Node.js project built using locomotive?
module.exports = function routes() {
this.root('pages#main');
this.match('/status', 'pages#status');
this.resources('paper');
this.resources('tempform');
};
How to add a new url suppose "paper/...
1
vote
1
answer
495
views
locomotivejs and mongoose: passing promise variables to a controller
preamble:
I'm not sure if this is the best way to ask this question as I'm fairly sure it's more general than I'm making it and there's probably a global pattern that address my concern.
For the ...
0
votes
1
answer
568
views
How to embed ECTJS views in LocomotiveJS
I have typical installation of locomotive JS. I want to use ECTJS for views. I have successfully installed ECTJS by using following command:
npm install ect --save
I have following controller:
var ...
0
votes
1
answer
343
views
How to use send in Locomotive Js
How can I use send() in action of controller in locomotive Js. I think LCM only provides render().
Can some one guide me in this regards.
5
votes
1
answer
1k
views
Catch "Failed to look up view" error and serve 404
I am currently routing every page to my pagesController that cannot be found in previous routes by including this line in routes.js:
this.match('/:page', { controller: 'pages', action: 'show' });
I ...
0
votes
1
answer
8k
views
How to return values from Mongoose query
I am working on a registration piece that does some server side validation before entering the data to mongo. I am very new to mongoose and am having trouble returning data to a method that completes ...
2
votes
1
answer
9k
views
Store sessions in mongodb with connect-mongo and mongoose
I am getting errors left and right while I try to configure the express.js session storage with mongodb. I am using locomotive for my framework and have configured mongoose.
In my initializers ...
2
votes
1
answer
3k
views
Add api token in middleware using express.js and locomotive.js
I'm building a rest api server that I will use with an angularjs frontend. I am trying to implement some middleware that runs on every request. For every request I want to check for an api token if ...
0
votes
1
answer
574
views
starting the locomotive.js application using nodemon
I've built an application using the Locomotive.JS MVC framework for node (locomotive is built upon express) , i wanted know how to start this application using nodemon??
1
vote
2
answers
240
views
LocomotiveJS Server Port Change
I am using locomotivejs for my node project. When I fire the lcm server command locomotive listen to port 3000 as default. I tried to change it but nothig worked. I thin I am missing something. From ...
0
votes
1
answer
81
views
How to obtain logs in locomotiveJS?
I am new to the locomotiveJS framework. I want to test my code and log some data. What is the proper way of loggin info in locomotiveJS?
0
votes
1
answer
172
views
Controlling Session Start with LocomotiveJS
I know it is possible to control session start with express and connect middleware. Like suggested here: Controlling Session Start with express and connect middleware
Is it possible to control ...
0
votes
1
answer
149
views
"Before All" filter broken if defined in the controller?
In my controller I define
PagesController.before('*', function(next) {
console.log('zip');
next();
});
And in routes.js I have
this.resources('pages', { only: [ 'index'] })
The "before" filter ...
2
votes
1
answer
185
views
Node.js custom render building
I'm building an API in node.js with express, and I would like to extend the basic res.send from ANY of the external route files before a response is sent, as to pre-format the response and append in ...
0
votes
3
answers
3k
views
Getting the error "no strategy registered under name: local" using passport
I'm using Locomotive, attempting to use passport. Still getting my head around the require function as the various guides aren't particularly clear on what I require to make things run. The following ...
0
votes
1
answer
101
views
Accessing express.js's connect
I am using Locomotive, and am wondering whether there is a way to access the connect that belongs to the express object somehow. Right now I am loading connect via require, and had to npm install --...
0
votes
1
answer
158
views
Locomotivejs Check MongoDB connection before all actions
I want to check MongoDB connection and reconnect to it if it's not in "connected" state, before any query is made to it from withing a LocomotiveJS server. A possible way is to add have it in the ...
0
votes
2
answers
3k
views
NodeJS Mysql Stop Server Crash on Error
I am using https://github.com/felixge/node-mysql
and everytime a mysql query throw an error, for example if a row does not exist. The node server crashes.
connection.connect();
connection.query('...
0
votes
1
answer
250
views
How to start an appfog locomotive.js app?
I'm using the node framework locomotive.js on an appfog instance. Installing this caused a slew of errors and I couldn't get the app to start. Reviewing the help materials and working with appfog ...
11
votes
1
answer
20k
views
NodeJs and Ejs Pass Arrays to page
I am trying to pass an array to an .ejs page, however when I try use
var test ="<%= data %>";
console.log(test);
I get the output
[object Object],[object Object],[object Object],[object ...
0
votes
1
answer
414
views
Mongoose Won't Add Document
I am trying to get entries added to mongo db from heroku scheduler. But currently I am just testing using "node app/bin/trackStats"
Here is my model.
var mongoose = require('mongoose');
var Schema =...
0
votes
1
answer
943
views
MongooseJS Find Max, Min and Avg Number
I have a MongoDB database containing a series of values including a Number field, I wish to get the maximum number, minimum and average. How is the best way to do this using mongoosejs and nodejs?