Closed g8d3 closed 11 years ago
Hmm... never thought about this case before. Yeah... a blank Blade template is invalid according to the Blade parser. Would you like this to be fixed?
Obviously a workaround is to simply include something in the Blade template. Even a //-
comment will work, but it won't render as anything.
yes, :+1:
Another thing, can you help me with this?, I am starting an application with Meteor, and:
include 'shared/map' # this does not work
!= Template 'shared/map' # this does
I have map.blade
file in my_app/client/views/shared/
directory.
what version of blade are you running? A recent update might have fixed your issue.
I have v3.0.0rc5 in smart.lock
file.
@juanpastas - Could you post the contents of map.blade
along with the full stack trace of the Error message you are getting? Also, Blade 3.0.0rc6 will correct the "Blank document" issue.
It just has a placeholder:
script src='https://maps.googleapis.com/maps/api/js?sensor=false'
.map the map
Also I would like the script tag to be included correctly, I think I am going to do this with a javascript helper, unless you have another suggestion, for example using blocks, I actually did not understand why blocks are not recommended with Meteor.
A few things...
1.) Your code in map.blade
should probably read:
script(src='https://maps.googleapis.com/maps/api/js?sensor=false')
.map the map
2.) Could you post the full stack trace of your error message? 3.) Blocks are not recommended in Meteor for a few reasons. Check this out: https://github.com/bminer/node-blade/wiki/Using-Blade-with-Meteor#wiki-block_limitations
1) actually I would want script to be included in head, how could I do that? 2) I am not having errors, what I am trying to do is 1) 3) that's difficult to understand for me, because I don't know which are the ways to work with templates in Meteor, I always see a template inside another template,
body
is populated with a template with Handlebars#Meteor.startup ->
$ ->
a = ->
$('body').html( Template['meals/index']() )
setTimeout a, 100 # just because a weird error spawning from jQuery mobile
#a= -> $('body').html( Template.mobile() )
#setTimeout a,100
meals/index
p index
!= Template['shared/map']()
shared/map
script(src='https://maps.googleapis.com/maps/api/js?sensor=false')
.map the map
Do you have a sample application for blade?
1.) Put it in head.blade
2.) See above
3.) Agreed. Having a template within another template is basically using the include
statement. Blocks, in these cases, aren't necessary.
4.) Blade was just changed (in 3.0.0 stable) to support dynamic body.blade
templates. The contents of this template are rendered just after the initial page load. See https://github.com/bminer/node-blade/wiki/Using-Blade-with-Meteor for more details.
5.) The whole setTimeout
call should not be necessary if you are using Meteor.startup
, correct? Otherwise, your templates look fine. Just make sure that you put your <script>
tag in head.blade
.
Hope that helps. Please feel free to email me or open another issue, if necessary. My contract info is here: http://blakeminer.com/contact.php
Hi, when I have a blank blade page, I get this: