Sha256: c7bc24ba45ceb6241b797cd4894b55b40b8e98c62efc66ba36c7658c4459cbc6

Contents?: true

Size: 980 Bytes

Versions: 1

Compression:

Stored size: 980 Bytes

Contents

import { EMBER_GLIMMER_ANGLE_BRACKET_INVOCATION } from '@ember/canary-features';
import { assert } from '@ember/debug';
import { Object as EmberObject } from '@ember/-internals/runtime';

export default EmberObject.extend({
  componentFor(name, owner, options) {
    assert(
      `You cannot use '${name}' as a component name. Component names must contain a hyphen${
        EMBER_GLIMMER_ANGLE_BRACKET_INVOCATION ? ' or start with a capital letter' : ''
      }.`,
      name.indexOf('-') > -1 || EMBER_GLIMMER_ANGLE_BRACKET_INVOCATION
    );

    let fullName = `component:${name}`;
    return owner.factoryFor(fullName, options);
  },

  layoutFor(name, owner, options) {
    assert(
      `You cannot use '${name}' as a component name. Component names must contain a hyphen.`,
      name.indexOf('-') > -1 || EMBER_GLIMMER_ANGLE_BRACKET_INVOCATION
    );

    let templateFullName = `template:components/${name}`;
    return owner.lookup(templateFullName, options);
  },
});

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
discourse-ember-source-3.6.0.0 dist/es/@ember/-internals/views/lib/component_lookup.js