title: Loopback - Easiest way to extend a built-in model
body: <p>I've been using Loopback to create an API. The documentation is generally really good but doesn't really answer my question about the following: how do I <strong>extend</strong> (not replace) a built in model?</p>
  
  <p>The most promising piece of information came from <a href="http://docs.strongloop.com/display/public/LB/Extending+built-in+models" rel="noreferrer">this page</a> - it specifies the way of basing a class from another class, via inheritance. This is useful but not ideal - I'd like to create relationships to custom models from the stock models, for example - "Role" should have many "Permission".</p>
  
  <p>The page I mention also shows a Javascript file, located at <code>common/models/&lt;modelName&gt;.js</code>, where it states you can "extend" a model based on the properties and options you give it. The server never seems to hit the file... For example - I put a file in <code>common/models/role.js</code> with the following content:</p>
  
  <pre><code>var properties = {
    exampleProperty: {type: String, required: true}
  };
  
  
  var user = loopback.Model.extend('Role', properties);
  console.log('test');
  </code></pre>
  
  <p>First off, it doesn't seem to hit the file at all (no <code>console.log</code> output given). Second, obviously because of the first point, it doesn't extend the model with the properties I created.</p>
  
  <p>Am I missing something obvious or is the documentation just plain wrong?</p>