How to use the ember-runtime/system/string.dasherize function in ember-runtime

To help you get started, we’ve selected a few ember-runtime examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github emberjs / ember.js / packages / ember-htmlbars / lib / streams / class_name_binding.js View on Github external
if (className && !!val) {
      return className;
    } else if (falsyClassName && !val) {
      return falsyClassName;
    } else {
      return null;
    }

  // If value is a Boolean and true, return the dasherized property
  // name.
  } else if (val === true) {
    // Normalize property path to be suitable for use
    // as a class name. For exaple, content.foo.barBaz
    // becomes bar-baz.
    let parts = path.split('.');
    return dasherize(parts[parts.length - 1]);

  // If the value is not false, undefined, or null, return the current
  // value of the property.
  } else if (val !== false && val != null) {
    return val;

  // Nothing to display. Return null so that the old class is removed
  // but no new class is added.
  } else {
    return null;
  }
}
github emberjs / ember.js / packages / ember-htmlbars / lib / helpers / -normalize-class.js View on Github external
if (!!value) {
      return activeClass;
    } else {
      return inactiveClass;
    }

  // If value is a Boolean and true, return the dasherized property
  // name.
  } else if (value === true) {
    // Only apply to last segment in the path.
    if (propName && isPath(propName)) {
      let segments = propName.split('.');
      propName = segments[segments.length - 1];
    }

    return dasherize(propName);

  // If the value is not false, undefined, or null, return the current
  // value of the property.
  } else if (value !== false && value != null) {
    return value;

  // Nothing to display. Return null so that the old class is removed
  // but no new class is added.
  } else {
    return null;
  }
}