How to use the aurelia-metadata.metadata.properties 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 adarshpastakia / aurelia-ui-framework / dist / native-modules / aurelia-ui-framework.js View on Github external
return function (target, property) {
        if (!property) {
            throw Error("Decorator should be used on property only!");
        }
        var meta = metadata.getOrCreateOwn(metadata.properties, ModelMetadata, target);
        meta.serializableProps.push(property);
        meta.propertyDefs[property] = {
            enumerable: true,
            get: target.propertyGetter(property),
            set: target.propertySetter(property)
        };
        meta.propertyDefs["_" + property] = {
            enumerable: false,
            value: defaultValue,
            writable: true
        };
    };
}
github adarshpastakia / aurelia-ui-framework / dist / native-modules / aurelia-ui-framework.js View on Github external
function UIDataModel(id) {
        this.busy = false;
        this.idProperty = "id";
        this.loaded = false;
        this.metadata = metadata.getOrCreateOwn(metadata.properties, ModelMetadata, Object.getPrototypeOf(this));
        Object.defineProperties(this, this.metadata.propertyDefs);
        this.metadata.original = __assign({}, this.serialize());
        this.metadata.updated = __assign({}, this.serialize());
        Object.defineProperties(this, {
            apiSlug: {
                enumerable: false,
                writable: true
            },
            busy: {
                enumerable: false
            },
            httpClient: {
                enumerable: false,
                value: Container.instance.get(UIHttpService),
                writable: false
            },
github adarshpastakia / aurelia-ui-framework / src / models / ui-data-model.ts View on Github external
return (target, property) => {
    if (!property) {
      throw Error("Decorator should be used on property only!");
    }

    const meta = Metadata.getOrCreateOwn(
      Metadata.properties,
      ModelMetadata,
      target
    ) as ModelMetadata;

    meta.serializableProps.push(property);
    meta.propertyDefs[property] = {
      enumerable: true,
      get: target.propertyGetter(property),
      set: target.propertySetter(property)
    };
    meta.propertyDefs["_" + property] = {
      enumerable: false,
      value: defaultValue,
      writable: true
    };
  };
github adarshpastakia / aurelia-ui-framework / src / data / ui-datasource.ts View on Github external
constructor(options: any = {}) {
    this.metadata = Metadata.getOrCreateOwn(Metadata.properties, DSMetadata, Object.getPrototypeOf(this)) as DSMetadata;

    this.logger = getLogger(this.constructor.name);

    options = Object.assign({}, DEFAULT_OPTIONS, options);

    Object.keys(options).forEach(key => (this.hasOwnProperty(key) && (this[key] = options[key]))
      || (this.metadata.hasOwnProperty(key) && (this.metadata[key] = options[key])));
  }
github adarshpastakia / aurelia-ui-framework / src / models / ui-data-model.ts View on Github external
return (target, property) => {
    if (!property) {
      throw Error("Decorator should be used on property only!");
    }

    const meta = Metadata.getOrCreateOwn(
      Metadata.properties,
      ModelMetadata,
      target
    ) as ModelMetadata;

    meta.serializableProps.push(property);
    meta.propertyDefs[property] = {
      enumerable: true,
      get: target.propertyGetter(property),
      set: target.propertySetter(property)
    };
    meta.propertyDefs["_" + property] = {
      enumerable: false,
      value: defaultValue,
      writable: true
    };
  };
github adarshpastakia / aurelia-ui-framework / dist / es2015 / aurelia-ui-framework.js View on Github external
return (target, property) => {
        if (!property) {
            throw Error("Decorator should be used on property only!");
        }
        const meta = metadata.getOrCreateOwn(metadata.properties, ModelMetadata, target);
        meta.serializableProps.push(property);
        meta.propertyDefs[property] = {
            enumerable: true,
            get: target.propertyGetter(property),
            set: target.propertySetter(property)
        };
        meta.propertyDefs["_" + property] = {
            enumerable: false,
            value: defaultValue,
            writable: true
        };
    };
}
github adarshpastakia / aurelia-ui-framework / dist / es2015 / data / ui-datamodel.js View on Github external
constructor(id) {
        this.busy = false;
        this.loaded = false;
        this.idProperty = 'id';
        this.metadata = Metadata.getOrCreateOwn(Metadata.properties, ModelMetadata, Object.getPrototypeOf(this));
        Object.defineProperties(this, this.metadata.propertyDefs);
        this.metadata.original = _.cloneDeep(this.serialize());
        this.metadata.updated = _.cloneDeep(this.serialize());
        Object.defineProperties(this, {
            id: {
                enumerable: true,
                writable: true
            },
            apiSlug: {
                enumerable: false,
                writable: true
            },
            idProperty: {
                enumerable: false,
                writable: true
            },
github adarshpastakia / aurelia-ui-framework / dist / es2015 / data / ui-datasource.js View on Github external
constructor(options = {}) {
        this.data = [];
        this.busy = false;
        this.loaded = false;
        this.paginate = false;
        this.metadata = Metadata.getOrCreateOwn(Metadata.properties, DSMetadata, Object.getPrototypeOf(this));
        this.logger = getLogger(this.constructor.name);
        options = Object.assign({}, DEFAULT_OPTIONS, options);
        Object.keys(options).forEach(key => (this.hasOwnProperty(key) && (this[key] = options[key]))
            || (this.metadata.hasOwnProperty(key) && (this.metadata[key] = options[key])));
    }
    load(dataList = []) {
github adarshpastakia / aurelia-ui-framework / src / data / ui-datamodel.ts View on Github external
constructor(id?) {
    this.metadata = Metadata.getOrCreateOwn(Metadata.properties, ModelMetadata, Object.getPrototypeOf(this)) as ModelMetadata;
    Object.defineProperties(this, this.metadata.propertyDefs);

    this.metadata.original = _.cloneDeep(this.serialize());
    this.metadata.updated = _.cloneDeep(this.serialize());

    Object.defineProperties(this, {
      id: {
        enumerable: true,
        writable: true
      },
      apiSlug: {
        enumerable: false,
        writable: true
      },
      idProperty: {
        enumerable: false,