New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doesn't work with new Angular 2 attribute syntax #20
Comments
So I've done some more comprehensive testing and found the following do not work: Does not work
Does work
Specifically it seems the
For the time being there are reasonable workarounds for everything, (in fact I may even prefer the |
@chrisnicola thank you for your investigation and issue report. Will take a look at this issue this weekend. |
@yury, no problem, let me know if I can help with any testing. |
Released v0.5.1 in which you can remove '[]' delimiters. Do you use express? app.engine('slm', require('slm').expressOpts({
attrDelims: { '(': ')' }
});
app.set 'view engine', 'slm' |
Do you have a workaround for the I know it's not usually a good idea to add a +1 comment, but I would like to say that I'm strongly interested in using slm with angular2. |
@yury no I just use webpack |
@Systho yes as mentioned above just write this: |
Rather than trying to get a grip on all this messing with new javascript html syntaxes, It would be convenient to have something we can wrap around the attributes so that they are not processed at all and just kept as is. For example it could be something like this: .my-item#custom-item{ #selectedItem *ngFor='item in items' (click)='selectItem()' } (Note: I did not look to see if this syntax is already used for something else but you get the idea) |
IIRC curly braces are already a supported delimiters for attributes, in fact you can use any brace style interchangibly. But yes it could make sense to have one of the brace styles allow for more flexible attribute names. I would support this approach. |
Out of curiousity what is Ruby SLM doing for this? |
I made the exact same suggestion on the angular issues over on the ruby slim repo. Haven't got a reply yet. |
@westonganger can you link to it? |
They may want to wait until it is no longer RC status, particularly considering the excessive level of changes going on during the RC. |
Here is the link to the issue on the SLIM repo: slim-template/slim#683 They could wait sure, but honestly have you seen the syntax for all these client side js frameworks? There is a lot of weird stuff out there. I just don't think its feasible to keep updating with every crazy html change any random framework decides to make. |
@yury removing It turns out that with the ruby version of slim you can do this by specifying only |
Also @yury even using
|
For me,
The others, even with complex values cases (like So, may be it is ok to do something like @westonganger suggested here #20 (comment), but there are not very many cases to implement, I think, even without any single-wrap blocks. Also I can see, that there were problems especially with splat operator, so things like |
Ok, I did this fork and made some changes, so every noted attributes are work now: It does not use { } blocks, just type angular2 attributes like regular ones. I am using this git in brunch plugin: https://github.com/sintro/slm-brunch and I don |
Basically something like this:
Throws a syntax error saying it is expecting an attribute. I'm assuming that is because SLM/SLIM expect
[]
to be used to surround attribute lists. I see no reason this can't be supported however.The text was updated successfully, but these errors were encountered: