jakubrohleder / angular-jsonapi

Simple and lightweight, yet powerful ORM for your frontend that seamlessly integrates with your JsonAPI server.
http://jakubrohleder.github.io/angular-jsonapi/
GNU General Public License v3.0
96 stars 34 forks source link

ReferenceError: Parse is not defined #47

Open arcreative opened 8 years ago

arcreative commented 8 years ago

Simply including the source file (min or not) doesn't work for me, it looks like it's utilizing a global var that's not defined:

(function() {
  'use strict';

  /* global Parse: false */
  angular.module('angular-jsonapi-parse', ['angular-jsonapi'])
    .constant('Parse', Parse);
})();

Went to run the demo with gulp serve as the documentation suggested to see if I could find out more, but that's not working either... I just get Cannot get /.

EDIT

Looks like this is just poorly documented and needs the following prior to launch:

<script src="lib/parse/parse.min.js"></script>
<script src="lib/pluralize/pluralize.js"></script>
<script src="lib/validate/validate.min.js"></script>
<script src="lib/angular-uuid4/angular-uuid4.min.js"></script>

That said, why do we need to include parse even if we don't want to use parse? Can't you conditionally set the constant so we don't have to include parse just to appease a module we're not using, or hack it e.g. <script>window.Parse = { iShould: 'notBeNeeded' };</script>?