angular-rails-templates icon indicating copy to clipboard operation
angular-rails-templates copied to clipboard

Failed to load template

Open thejourneydude opened this issue 9 years ago • 2 comments

I have the following file structure

assets
    - javascripts
        - angular
            - test
                - user.component.js
    - templates
        - test.html

In my user.component.js file, I have

templateUrl: 'test.html'

When I load the page, I receive the following error:

Error: [$compile:tpload] Failed to load template: templates/test.html (HTTP status: 404 Not Found)

I have user.component.js loaded and running on a HTML page. If I replace templateUrl with template: '<h1>Hello</h1>' then everything works just fine.

I have the following relevant gems:

  • Rails 4.2.6
  • Sprockets 3.6
  • Angular Rails Template 1.0.2

What's wrong and how do I fix this?

thejourneydude avatar Feb 15 '17 19:02 thejourneydude

Same problem here. I'm upgrading an application from 3.2 to 4.0. The code worked fine in 3.2. In 4.0 it gives the above error in the browser console, and in the rails log:

ActionController::RoutingError (No route matches [GET] "/job_creation_wizard/update/common/tag_editor.html"):

tag_editor.html is in app/assets/templates/common/tag_editor.html.

My directive has: templateUrl: 'common/tag_editor.html',

What am I doing wrong?

Thanks

aeldaly avatar Apr 20 '17 16:04 aeldaly

upgrading to version 0.3.0 fixed it

aeldaly avatar Apr 20 '17 16:04 aeldaly