Skip to content
Michael Rüfenacht edited this page Jul 10, 2018 · 4 revisions

Loopback Mixins are defined as a function:

  module.exports = function(model, options){
    // do your magic
  }

To make the Mixins available to the models one has to either add the source dir (or the files) to the _meta section of the model-config.json:

{
  "_meta": {
    "mixins": [
      "loopback/server/mixins",
      "../mixindir/relative/to/the/appRootDir",
      "@joinbox/thingy/mixins/whuat"
    ]
  }
}

Clone this wiki locally