You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 27, 2024. It is now read-only.
I really enjoy using Underscore and Angular together, and I was really stoked to use this for filters and whatnot, but could you toss up some more examples of how you're using it?
The text was updated successfully, but these errors were encountered:
Short answer: The refactoring technique Inline Temp.
Many underscore's using contexts with angular often introduce temporal names, perhaps they could be assigned more practical names, but it maybe just an overhead.
<ling-repeat="(dueDate, books) in booksGroupByDueDate">
{{dueDate}}
<ul><ling-repeat="book in books">
{{book.name}}
</li></ul></li><ling-repeat="(owner, books) in booksGroupByOwner">
{{owner}}
<ul><ling-repeat="book in books">
{{book.name}}
</li></ul></li><ling-repeat="(lib, books) in booksGroupByLib">
{{lib}}
<ul><ling-repeat="book in books">
{{book.name}}
</li></ul></li>
doesn't it look better:
js:
$scope.books=[...book's collection];
html:
<ling-repeat="(dueDate, books) in books|groupBy:'dueDate'">
{{dueDate}}
<ul><ling-repeat="book in books">
{{book.name}}
</li></ul></li><ling-repeat="(owner, books) in books|groupBy:'owner'">
{{owner}}
<ul><ling-repeat="book in books">
{{book.name}}
</li></ul></li><ling-repeat="(lib, books) in books|groupBy:'lib'">
{{lib}}
<ul><ling-repeat="book in books">
{{book.name}}
</li></ul></li>
If you use underscore heavily, you may find many codes could be refactoried in favor of angular's expression.
To give more examples is OK but need time to coin good examples, maybe community could contribute their usecases.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I really enjoy using Underscore and Angular together, and I was really stoked to use this for filters and whatnot, but could you toss up some more examples of how you're using it?
The text was updated successfully, but these errors were encountered: