0

in my app.js I have included the dependency for flow

var myApp = angular.module('myApp',['ui.router', 'ngResource', 'flow']);

I have included the javascript in my index file to load as follows

<script type="text/javascript" src="//cdn.jsdelivr.net/flow.js/2.0.0b2/flow.js"></script>

I am getting the error Module 'flow' is not available!

Uncaught Error: [$injector:modulerr] Failed to instantiate module myApp due to:
Error: [$injector:modulerr] Failed to instantiate module flow due to:
Error: [$injector:nomod] Module 'flow' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
http://errors.angularjs.org/1.2.23/$injector/nomod?p0=flow
user2180794
  • 1,425
  • 7
  • 27
  • 50
  • did u add the `flow.js` below to the `angular.js` and top to the `app.js` – Kalhan.Toress Nov 09 '14 at 05:45
  • 1
    also u need to add `angular flow` `https://github.com/flowjs/ng-flow/blob/master/dist/ng-flow.js` – Kalhan.Toress Nov 09 '14 at 05:53
  • that seems to work, now I have both. can you explain what is the difference ? – user2180794 Nov 09 '14 at 06:16
  • `flow.js` can use with `jquery` but when u use `angularjs` there is angularjs version of flow.js called `ng-flow.js` in `ng-flow` u can have the `angular modules` but in plain `flow.js` u dont have modules – Kalhan.Toress Nov 09 '14 at 06:36
  • and u dont need the plain `flow.js`. remove it. `ng-flow.js` should be enough – Kalhan.Toress Nov 09 '14 at 06:37
  • I am using this ..is that the right one ? – user2180794 Nov 09 '14 at 13:54
  • can you please share some examples .. I am not sure how to call flow in my controller. I googled , but examples are hard to find. appreciate your help. – user2180794 Nov 09 '14 at 14:07
  • For a detailed solution when using MeanJS, see [Installing and injecting ng-flow using yeoman][1]. [1]: http://stackoverflow.com/questions/26394686/installing-and-injecting-ng-flow-using-yeoman – Doug May 16 '15 at 11:05

2 Answers2

2

This is probably because if you want to use the ['flow'] module in angularJs you have to include both:flow.js and ng-flow. If you are using bower and it is configured to place the libraries on the js/vendor you would have to do something like this.

bower install "ng-flow#~2" --save


{{ HTML::script('js/vendor/flow.js/dist/flow.min.js') }}
{{ HTML::script('js/vendor/ng-flow/dist/ng-flow.min.js') }}

If you are not, just look for a ng-flow CDN.

Best regards!

  • This is the problem I ran into. I used bower to install it and missed the "ng-flow" directory. – inki Apr 21 '15 at 21:56
0

you need to include http: before your cdn:

change your script to this and it should work:

<script type="text/javascript" src="http://cdn.jsdelivr.net/flow.js/2.0.0b2/flow.js"></script>
ashfaq.p
  • 5,379
  • 21
  • 35
  • No it does matter. Try to check in development tools for resources that are getting loaded and you will see that the cdn failed to load. – ashfaq.p Nov 09 '14 at 06:13
  • Why exactly should "http:" be included? You don't provide any explanation. – a better oliver Nov 09 '14 at 12:11
  • URL's without a protocol are assumed to be in the same domain as the page. So `cdn.jsdelivr.net` is just part of the path. – Jim Cote Nov 09 '14 at 16:04
  • including http is very assumptions that the application will not be run under ssl. The simple '//path' will work just fine. SSL or not. – iCreateAwesome Feb 27 '15 at 00:00