Skip to content

maxProperty doesn't have a good way to use "default" #77

@jamesarosen

Description

@jamesarosen

😄 If I don't pass a yMax, I get a nice default behavior:

{{ember-nf-graph}}

😄 If I do pass a yMax, I can get a nice override:

{{ember-nf-graph yMax=100 class='percent-graph'}}

😢 But there's no way for me to use yMax=someBoundProperty that might be undefined or might be an integer. If it's undefined, then yMax gets set to undefined, not to the default behavior.

I think an easy solution would be to change the logic in the maxProperty to use the override only if it's not null:

// was:
if(arguments.length > 1) {
  this[__Max_] = value;
} else {

// suggested:
if (value != null) {
  this[__Max_] = value;
} else {

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions