Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to load template #150

Open
thejourneydude opened this issue Feb 15, 2017 · 2 comments
Open

Failed to load template #150

thejourneydude opened this issue Feb 15, 2017 · 2 comments

Comments

@thejourneydude
Copy link

thejourneydude commented Feb 15, 2017

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?

@aeldaly
Copy link

aeldaly commented Apr 20, 2017

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
Copy link

aeldaly commented Apr 20, 2017

upgrading to version 0.3.0 fixed it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants