pitr / angular-rails-templates

Use your angular templates with rails' asset pipeline
https://rubygems.org/gems/angular-rails-templates
MIT License
566 stars 169 forks source link

Having issues with 'angular-cookie' loading #146

Closed mdere closed 8 years ago

mdere commented 8 years ago

Hey angular-rails-templates team - I am new to the angular world - so I ran into the following issue that I can't seem to figure out (and I will be still finding a solution after submitting this....if so I'll close this issue myself)

so I get this following error in console: jquery.self-d4bd3e8….js?body=1:3794 Uncaught Error: [$injector:modulerr] Failed to instantiate module TowerOfTexteria due to: Error: [$injector:modulerr] Failed to instantiate module angular-cookie due to: Error: [$injector:nomod] Module 'angular-cookie' 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.5.8/$injector/nomod?p0=angular-cookie

I have the following configurations:

app.js:

angular.module('TowerOfTexteria',[
  'templates',
  'ngRoute',
  'controllers',
  'angular-cookie',
  'ng-token-auth'
])

application.js

//= require jquery
//= require jquery_ujs
//= require angular/angular
//= require angular-route/angular-route
//= require angular-rails-templates
//= require bootstrap
//= require angular-cookie
//= require_tree ../templates
//= require_tree .

I am using bower DSL to manage my assets and I can confirm that it does indeed exist bower_components: image

I also confirmed that I loaded the assets correctly in application.rb

    config.autoload_paths << Rails.root.join('lib')
    config.assets.paths << Rails.root.join("vendor","assets","bower_components")

    config.assets.precompile << %r(.*.(?:eot|svg|ttf|woff|woff2)$)  

Am I missing something? It loads angular just fine - not sure what is wrong...

Thanks in advance

mdere commented 8 years ago

Ok I figured it out - was confused on whether to reference the export from the src file or not. but it's not complaining anymore.