Skip to content
This repository has been archived by the owner on Sep 16, 2022. It is now read-only.

[FeatChange & Opinions]: Some adjustments in the templates for >= v6 #1639

Closed
akaufmann opened this issue Oct 11, 2018 · 1 comment
Closed

Comments

@akaufmann
Copy link

Hi,

I'm using AngularDart and Angular a lot and if you use something very often you will come up with ideas on how to make the job a little easier/cleaner 😄 Maybe that's not the direction the AngularDart team wants to go or is not so easy to change, but I'm still trying... 😅:

Dart's ${expression} for interpolation:

<span>${ foo.x }</span> // or just {foo.x}

Capitalized names for Angular components + one-way/two-way data binding without quotation marks:

<Foo x=foo.x /> <!-- one-way data binding -->
<Foo [x]=foo.x />  <!-- two-way data binding -->
<a routerLink=xURL>...</a>

NgIf | NgFor | ... directives more inline with HTML-Attributes:

<div if=(foo.x > 5) (click)=someFn>...</div>
<div else-if=(foo.x == 5)>...</div>
<div else>...</div>

<div for=(x of xs)>...</div>

What do you think of it? Is that something that makes sense?

@alorenzen
Copy link
Contributor

I actually like the <span>${foo.x}</span> syntax. If we were starting from scratch, I'd be in favor of picking that.

That said, I'm not sure if it is worth migrating all existing code to that syntax. Even supporting both would be a burden on our users, as it would be inconsistent between files or even sometimes within the same file.

We've discussed using the class name for components instead of the selector. No actual plans there yet, but there are some on the team really pushing for it.
Same with if/for vs ngIf/ngFor.

Thanks for the suggestions.

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

No branches or pull requests

2 participants