Skip to content
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

Angular 2 and jade #2223

Closed
blacksails opened this issue Jan 22, 2016 · 6 comments
Closed

Angular 2 and jade #2223

blacksails opened this issue Jan 22, 2016 · 6 comments

Comments

@blacksails
Copy link

I have an issue which somewhat makes me unable to combine Angular 2 and jade.

The following jade code

input([(test1)]="test1" [(test2)]="test2")

translates into

<input [(test1)]="test2"/>

Does anyone know of a workaround?

@blacksails
Copy link
Author

I found that it works as it should with the &attributes syntax:

input&attributes({"[(test1)]": "test1", "[(test2)]": "test2"})

But I really dislike that syntax. I am interested in a better alternative.

@TimothyGu
Copy link
Member

You can either quote the attributes or use a comma:

input("[(test1)]"="test1" "[(test2)]"="test2")
input([(test1)]="test1", [(test2)]="test2")

Otherwise the attribute is interpreted as:

"test1" [(test2)]="test2"
("test1" [(test2)])="test2"
("test1"[test2]) = "test2"
"test2"

@blacksails
Copy link
Author

@TimothyGu Ahh thanks alot!

@Rush
Copy link

Rush commented Sep 2, 2016

I wonder, is it possible to improve the parser to support the good old spaces and no quoting with these new attributes?

@ganySA
Copy link

ganySA commented Sep 4, 2016

+1

@ForbesLindesay
Copy link
Member

It isn't, because foo [bar] is a valid JavaScript expression. e.g. const foo = ['a'], bar = 0; console.log(foo [bar]); would log a.

@pugjs pugjs locked and limited conversation to collaborators Sep 5, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants