How to use the aurelia-metadata.metadata.define function in aurelia-metadata

To help you get started, we’ve selected a few aurelia-metadata 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 aurelia / binding / src / value-converter-resource.js View on Github external
export function valueConverter(nameOrTarget) {
  if (nameOrTarget === undefined || typeof nameOrTarget === 'string') {
    return function(target) {
      metadata.define(metadata.resource, new ValueConverterResource(nameOrTarget), target);
    };
  }

  metadata.define(metadata.resource, new ValueConverterResource(), nameOrTarget);
}
github aurelia / templating / dist / aurelia-templating.js View on Github external
let deco = function(t) {
    metadata.define(metadata.resource, new ElementConfigResource(), t);
  };
github aurelia / templating / dist / es2015 / aurelia-templating.js View on Github external
let deco = function (t) {
    metadata.define(metadata.resource, new ViewEngineHooksResource(), t);
  };
github aurelia / dependency-injection / dist / native-modules / aurelia-dependency-injection.js View on Github external
var deco = function (target) {
        metadata.define(metadata.invoker, FactoryInvoker.instance, target);
    };
    return potentialTarget ? deco(potentialTarget) : deco;
github aurelia / binding / src / decorators.js View on Github external
export function bindingBehavior(nameOrTarget){
  if(nameOrTarget === undefined || typeof nameOrTarget === 'string'){
    return function(target){
      metadata.define(metadata.resource, new BindingBehaviorResource(nameOrTarget), target);
    }
  }

  metadata.define(metadata.resource, new BindingBehaviorResource(), nameOrTarget);
}
github aurelia / dependency-injection / dist / aurelia-dependency-injection.js View on Github external
let deco = function(target) {
    metadata.define(metadata.invoker, FactoryInvoker.instance, target);
  };
github aurelia / dependency-injection / dist / native-modules / aurelia-dependency-injection.js View on Github external
return function (target) {
        metadata.define(metadata.invoker, value, target);
    };
}
github aurelia / dependency-injection / src / invokers.ts View on Github external
const deco = (target: DependencyCtor) => {
    metadata.define(metadata.invoker, FactoryInvoker.instance, target);
  };
github aurelia / templating / dist / aurelia-templating.js View on Github external
} else if (exportedValue instanceof ViewStrategy) {
        viewStrategy = exportedValue;
      } else if (exportedValue instanceof TemplateRegistryEntry) {
        viewStrategy = new TemplateRegistryViewStrategy(moduleId, exportedValue);
      } else {
        if (conventional = HtmlBehaviorResource.convention(key)) {
          if (conventional.elementName !== null && !mainResource) {
            mainResource = new ResourceDescription(key, exportedValue, conventional);
          } else {
            resources.push(new ResourceDescription(key, exportedValue, conventional));
          }

          metadata.define(metadata.resource, conventional, exportedValue);
        } else if (conventional = ValueConverterResource.convention(key)) {
          resources.push(new ResourceDescription(key, exportedValue, conventional));
          metadata.define(metadata.resource, conventional, exportedValue);
        } else if (!fallbackValue) {
          fallbackValue = exportedValue;
          fallbackKey = key;
        }
      }
    }

    if (!mainResource && fallbackValue) {
      mainResource = new ResourceDescription(fallbackKey, fallbackValue);
    }

    resourceModule.moduleInstance = moduleInstance;
    resourceModule.mainResource = mainResource;
    resourceModule.resources = resources;
    resourceModule.viewStrategy = viewStrategy;