<a href="@item.html">...
Closed this issue · 3 comments
fghhfg commented
Code:
<div>
@model.xxx.forEach(function(item){
<a href="@item.html">@item</a>
})
</div>
model.xxx = ['home', 'product', ...]
Expected:
<div>
<a href="home.html">home</a><a href="product.html">product</a>...
</div>
What I got:
<div>
<a href="">home</a><a href="">product</a>...
</div>
And how do make it newline?
I want my html become:
<div>
<a href="home.html">home</a>
<a href="product.html">product</a>
...
</div>
it is more readable...
kirbysayshi commented
The new lines should be kept, not sure why they’re not.
The expression @item.html tells vash to look for an html property on the
item object. You can try either:
@(item + “.html”)
@(item).html
I’m not sure the second will work. The first one with manual concatenation
should though.
…On Fri, Oct 13, 2017 at 9:17 AM fghhfg ***@***.***> wrote:
*Code*:
<div>
@model.xxx.forEach(function(item){
<a ***@***.******@***.***</a>
})
</div>
model.xxx = ['home', 'product', ...]
*Expected*:
<div>
<a href="home.html">home</a><a href="product.html">product</a>...
</div>
*What I got*:
<div>
<a href="">home</a><a href="">product</a>...
</div>
------------------------------
And how do make it newline?
I want my html become:
<div>
<a href="home.html">home</a>
<a href="product.html">product</a>
...
</div>
it is more readable...
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#122>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAFiz5Xspt1sR98Q9K2YCFX_RousLllvks5sr2LxgaJpZM4P4eTL>
.
fghhfg commented
You are so quick!
@(item + “.html”)
: this one works.
@(item).html
: this one doesn't work.
thank you.
kirbysayshi commented
Thanks for reporting back, and glad to help!
…On Fri, Oct 13, 2017 at 9:31 AM fghhfg ***@***.***> wrote:
You are so quick!
@(item + “.html”) : this one works.
@(item).html: this one doesn't work.
thank you.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#122 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAFiz7lj6is4iSZRYQCf98QFm_pInr2iks5sr2YagaJpZM4P4eTL>
.