javascript - angular-rails-templates Failed to load template -


i'm trying angular load template:

var app = angular.module("myapp", ['templates']) 

and html:

<div ng-app="myapp">   <div ng-include="'blah.html'"></div> </div> 

but 404 failed load resource because, rails tells me, no route matches [get] "/blah.html". understand because of asset pipeline in rails. blah.html in /app/assets/javascripts/templates/blah.html , using angular-rails-templates gem try solve problem. application.js has:

//= require angular-rails-templates //= require_tree ./templates 

but i'm not having luck.

the html generated suggests angular-rails-templates loading (it has script /assets/angular-rails-templates....js) rails failing find blah.html

versions:
rails 4.2.1
angular-rails-templates 0.1.4
angularjs 1.3.15

this turned out sprockets incompatibility (see here , here)

the short version is:

  1. add gem 'sprockets', '2.12.3' gemfile
  2. run bundle update sprockets

[update] i'm no expert on stuff seem number of people smarter suggesting using /public/templates. may want bear in mind.


Comments

Popular posts from this blog

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

order - Notification for user in user account opencart -