Couch Potato needs RequireJS in order to be useful. However, it is not necessary for your application to be bootstrapped using AMD. You have two options:
If you use traditional script tags to load the module (i.e. you aren't using AMD to structure your the non-lazy portion of your application, you must load the following three scripts in this order (other modules can be loaded wherever it makes sense for you, but these three must follow the order):
RequireJS
<!-- in index.html --> <script src="/js/angular.min.js"></script> <script src="/js/angular-couch-potato.min.js"></script> <script src="/js/require.min.js"></script>
If you use RequireJS, Couch Potato will first try to use an AMD module
that is defined with the name 'angular'
. If it does not find
that, it will try to use an angular object defined as
window.angular
. This flexibility allows you to load angular
from a script tag (if you do so before your require.js script tag)
or from RequireJS -- the distinction will be critical if you are
using multiple instances of angular (in which case I pity you for
needing to, even though I understand that there are edge cases
where it is necessary) -- it must be very painful.
Reference Couch Potato as a Dependency as follows:
var myModule = angular.module('myApp', ['myOtherDep', 'scs.couch-potato']);
See also the $couchPotatoProvider documentation.