New to Sails.js I've read over the docs but I don't see a way to NOT include the layout.ejs
located in /views/
.
I'm trying to implement Angular into my app and when I go
$routeProvider.when('/',{
controller: 'HomeController',
templateUrl: '/home'
})
So then in my routes I expect to be able to do:
'GET /home': { view: 'angular/home.ejs' }
But what happens is it loads home.ejs
but also injects layout.ejs
so it becomes an endless loop of injecting layout.ejs
loading angular scripts from layout, then trying to load home.ejs
which loads layout.ejs
so on so forth
So how can I do this?
I know I can put views in /asset/angular/home.html
but I would like to have .ejs
so that I can render a different view (e.g. user is not logged in) or something.
Any information on how I can render views
without injecting layout.ejs
would be great, thanks!
Update:
So by doing this:
'GET /home': {
view: 'home',
locals: {
layout: false
}
}
it makes it work, I don't know if there is a global way so I don't have to flag layout: false
for each one
layout : false
under /config/view.js
.To disable layout individually, leave /config/view.js
alone and do something like this in your routes:
'GET /home': {
view: 'home',
locals: {
layout: false
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With