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

Added fallback on model.get() #1634

Closed
wants to merge 1 commit into from
Closed

Added fallback on model.get() #1634

wants to merge 1 commit into from

Conversation

gsdevme
Copy link

@gsdevme gsdevme commented Sep 7, 2012

Allows for a view, template etc to define a fallback if the attribute
is null or undefined … nice to have it other then undefined in the
rendered templates

Allows for a view, template etc to define a fallback if the attribute
is null or undefined … nice to have it other then undefined in the
rendered templates
@braddunbar
Copy link
Collaborator

Hi @gsdevme, thanks for the patch! If you're interested, this has been discussed previously a couple of times in #1184 and others.

There's really no need for a fallback for get. You can just use model.get('attr') || value instead, which is approximately the same number of keystrokes and very readable.

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

Successfully merging this pull request may close these issues.

None yet

2 participants