Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

[Q] Should with support the filter syntax |filter(arg1, arg2) #772

Closed
vicb opened this issue Mar 20, 2014 · 10 comments
Closed

[Q] Should with support the filter syntax |filter(arg1, arg2) #772

vicb opened this issue Mar 20, 2014 · 10 comments

Comments

@vicb
Copy link
Contributor

vicb commented Mar 20, 2014

See the discussion in #758. I'm creating the issue as the PR should be closed soon.

TL;DR:

  1. The current syntax is |filter:arg1:arg2 and comes from Django & Smarty,
  2. The proposed syntax |filter(arg1, arg2) comes from Jinja & Twig

The proposed syntax should allow for named arguments as well.

If we go for the second syntax and support named arguments, the current syntax should probably be dropped.

Thoughts ?

@chalin
Copy link
Contributor

chalin commented Mar 20, 2014

Two 👍 for option 2. IMHO, AngularDart should match Dart syntax and semantics to every extent possible. (And the influence is two way: e.g., as you already know, that is why I asked for function pipes to be added to Dart.)

@zoechi
Copy link
Contributor

zoechi commented Mar 20, 2014

👍 option 2 (for me this is call/parameter list syntax for any C like language (I have no idea what Django/Smarty/Jinja/Twig are)

chalin added a commit to chalin/angular.dart that referenced this issue Mar 20, 2014
@chalin
Copy link
Contributor

chalin commented Apr 8, 2014

This still in the works?

@vicb
Copy link
Contributor Author

vicb commented Apr 8, 2014

After having discussed with @mhevery, the status is that the current syntax is fine unless an other one would have obvious benefits

@vicb vicb closed this as completed Apr 8, 2014
@vicb
Copy link
Contributor Author

vicb commented May 3, 2014

@chalin
Copy link
Contributor

chalin commented May 3, 2014

Great! Again, I vote for this in Angular too.

@zoechi
Copy link
Contributor

zoechi commented May 4, 2014

I vote for this too.
I still have a hard time to remember the current syntax because nothing similar exists anywhere else in Dart. It's just unintuitive. Every time I needed this I had to look the syntax up.
Maybe I should learn Django and Smarty ...

@zoechi
Copy link
Contributor

zoechi commented May 21, 2014

here is a similar discussion going on googlearchive/polymer-expressions#32

@chalin
Copy link
Contributor

chalin commented May 21, 2014

@zoechi, the link you provided doesn't work for me.

@zoechi
Copy link
Contributor

zoechi commented May 21, 2014

@chalin sorry for that! I updated the link.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants