Skip to content

Instantly share code, notes, and snippets.

@nhajratw
Created December 11, 2013 14:56
Show Gist options
  • Save nhajratw/7911774 to your computer and use it in GitHub Desktop.
Save nhajratw/7911774 to your computer and use it in GitHub Desktop.
angular-lineman-template app.js rewritten as app.coffee
app = angular.module("app", ["ngResource", "ngRoute"]).run ($rootScope) ->
# adds some basic utilities to the $rootScope for debugging purposes
$rootScope.log = (thing) ->
console.log(thing)
$rootScope.alert = (thing) ->
alert(thing)
@nhajratw
Copy link
Author

Uncaught Error: [$injector:modulerr] Failed to instantiate module app due to:
Error: [$injector:nomod] Module 'app' 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.4/$injector/nomod?p0=app
at http://localhost:8000/js/app.js:78:12
at http://localhost:8000/js/app.js:1524:17
at ensure (http://localhost:8000/js/app.js:1449:38)
at module (http://localhost:8000/js/app.js:1522:14)
at http://localhost:8000/js/app.js:3555:22
at Array.forEach (native)
at forEach (http://localhost:8000/js/app.js:300:11)
at loadModules (http://localhost:8000/js/app.js:3549:5)
at createInjector (http://localhost:8000/js/app.js:3489:11)
at doBootstrap (http://localhost:8000/js/app.js:1294:20)
http://errors.angularjs.org/1.2.4/$injector/modulerr?p0=app&p1=Error%3A%20%…t%20doBootstrap%20(http%3A%2F%2Flocalhost%3A8000%2Fjs%2Fapp.js%3A1294%3A20)

@davemo
Copy link

davemo commented Dec 11, 2013

This looks right to me, unless something changed in the newest release of angular :/

@davemo
Copy link

davemo commented Dec 11, 2013

You'll need to update the concatenation order as per instructions in lineman-angular-template

Here's what I've overridden my config/application.js to:

/* Exports an object that defines
 *  all of the configuration needed by the projects'
 *  depended-on grunt tasks.
 *
 * You can find the parent object in: node_modules/lineman/config/application.coffee
 */

module.exports = require(process.env['LINEMAN_MAIN']).config.extend('application', {
  concat_sourcemap: {
    js: {
      src: [
        "<%= files.js.vendor %>",
        "<%= files.coffee.generated %>",
        "<%= files.js.app %>",
        "<%= files.ngtemplates.dest %>"
      ]
    }
  }
});

@theotherzach
Copy link

@nhajratw Would you be able to push your repo to github so I can pull it down? I ran into some issues with ngtemplates that were non-obvious but I assumed that they were because I was working on a Chrome extension. If I can take a look I may be able to come up with something.

@searls
Copy link

searls commented Dec 15, 2013

Nayan, would you be able to share the project? I've changed enough about the lineman angular template lately that I want to aggressively take the blame, but that doesn't really help solve your problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment