title: Designing models in Angular
body: <p>I am having very hard times choosing a definite way to create models in Angular. For several weeks, I've been doing things like this:</p>
  
  <pre><code>documentModule.factory('Document',function(){
  
      function MyModel(){
          this.prop = ''
      }
  
      MyModel.prototype.foobar = function(){
          // Some logic to perform on model data
      };
  
      return{
          getInstance: function(){
              return new MyModel();
          }
      }
  
  });
  </code></pre>
  
  <p>I add all methods that are working with model data to the prototype.</p>
  
  <p>I recently had the pleasure to read a free ebook on "Human JavaScript" which you may have already stumbled upon: <a href="http://read.humanjavascript.com" rel="nofollow">http://read.humanjavascript.com</a></p>
  
  <p>In chapter 7, 'Models', they introduce a way of providing the model to the application that has imposed on me. I like the idea of "being able to open the code for the model and read what properties it stores and what types those properties have"</p>
  
  <p>However, I am not a too smart man myself and can't come up with a solution to use this with Angular. Also, how are you working with models?</p>
  
  <p><strong>What are your thoughts about this concept and would you recommend to implement something similiar with Angular? If so, how would you begin?</strong></p>