Comments (14)
Hmmmm. I just released a new version and I'm not seeing that. Could you give these versions a try and see if you still have the same issue:
compile ":asset-pipeline:2.0.12"
compile ":angular-template-asset-pipeline:2.0.2"
from angular-template-asset-pipeline.
Tried that and I get the same behavior as with 2.0.1 and 2.0.10.
My grails-app/assets
tree looks like
grails-app
assets
javascripts
my-app
templates
foo.js
greet.tpl.html
main.js
and main.js is:
//= require angular-1.3.5/angular
//= require_self
//= require_tree my-app/templates
angular.module('myApp', [])
.controller('TestController', ['$scope', function ($scope) {
$scope.hello = 'world';
}]);
with 1.4.2 and asset-pipeline
1.9.9, I see this in the head section of my page:
<head>
<title>Template Test</title>
<link rel="stylesheet" href="/template-test/assets/main.css?compile=false" />
<script src="/template-test/assets/angular-1.3.5/angular.js?compile=false" type="text/javascript" ></script>
<script src="/template-test/assets/main.js?compile=false" type="text/javascript" ></script>
<script src="/template-test/assets/my-app/templates/foo.js?compile=false" type="text/javascript" ></script>
<script src="/template-test/assets/my-app/templates/greet.js?compile=false" type="text/javascript" ></script>
</head>
But changing versions to 2.0.2 and 2.0.12, I get:
<head>
<title>Template Test</title>
<link rel="stylesheet" href="/template-test/assets/main.css?compile=false" />
<script src="/template-test/assets/angular-1.3.5/angular.js?compile=false" type="text/javascript" ></script>
<script src="/template-test/assets/main.js?compile=false" type="text/javascript" ></script>
<script src="/template-test/assets/my-app/templates/foo.js?compile=false" type="text/javascript" ></script>
</head>
from angular-template-asset-pipeline.
Thanks for the example, I see exactly what you mean now. If you require the file explicitly it does work:
//= require /my-app/templates/greet.tpl.html.js
I'm not saying that's a particularly appealing work-around, but it does point to an issue with the asset pipeline itself (specifically require_tree).
I'll confirm that and see if I can get a pull request submitted to address that. I'll keep you posted.
from angular-template-asset-pipeline.
Yep, it works for me with an explicit require.
from angular-template-asset-pipeline.
Update on this. With the recent version of Asset Pipeline (2.0.19) the tpl.htm files will work with require_tree
just not the tpl.html files at the moment. I'll close this out when those files work as well.
from angular-template-asset-pipeline.
Looks like this is resolved with version 2.1.0 of the asset pipeline (both tpl.htm and tpl.html should now work).
from angular-template-asset-pipeline.
I'm finally getting around to trying the new versions in my test app. I updated BuildConfig.groovy
to
compile ":asset-pipeline:2.1.0"
compile ":angular-template-asset-pipeline:2.0.3"
and did grails refresh-dependencies
. I'm still seeing the same behavior as before; the script tag loading the template isn't included with require_tree
but is if I use an explicit require.
Is there something else I need to do?
from angular-template-asset-pipeline.
I don't think so. I'll have to take a look again. I was pretty sure this was fixed but I very well could be wrong.
from angular-template-asset-pipeline.
Yeah looks like the issue with .tpl.html is still there (workaround is to use .tpl.htm). I'll keep you posted on when that looks like its resolved in the asset pipeline core project.
from angular-template-asset-pipeline.
This is still an issue. Can you update docs to say something about the html vs htm issue?
from angular-template-asset-pipeline.
@ctoestreich I thought I already removed all the references to tpl.html (as opposed to tpl.htm) from the docs (let me know if I missed one).
Adding back support for tpl.html will involve a change to the Asset pipeline core project. I know this one is on @davydotcom's radar already.
from angular-template-asset-pipeline.
@craigburke Yeah I am sure he is working on it. I see that you have the "use tml.htm" on the docs, but I think it needs to be explicit that the *html is broken atm. I got tripped up as I was using your https://github.com/craigburke/lazybones-angular-grails and more specifically https://github.com/craigburke/lazybones-angular-grails/tree/master/templates/angular-grails/grails-app/assets/vendor/grails/templates/directives as a reference for a grails angular app and that still has html as the file extension.
from angular-template-asset-pipeline.
@ctoestreich yeah, that's a good idea. I've made the change to the docs.
from angular-template-asset-pipeline.
@ctoestreich should work now if you use version 2.2.0 of the asset pipeline thanks to @davydotcom.
from angular-template-asset-pipeline.
Related Issues (20)
- Line breaks are not formatted properly HOT 16
- Plugin poping errors at runtime HOT 4
- Module name problem on windows HOT 16
- File path tokenize fails with the use of GenericAssetFile HOT 5
- Template file not being added to the cache HOT 7
- Templates do not work in Grails 3 Jar HOT 18
- Allow for module name default HOT 15
- Is it possbile to have multiple template folders? HOT 4
- configOptions take no effect for Grails 3 in build.gradle HOT 3
- Error 500 on generated template js files HOT 3
- Mismatch in path vs cache name HOT 1
- Camel Case HOT 5
- Line ends are broken when template html is minimized for <script> tag HOT 6
- Display issue when using templates HOT 1
- Wrong module name if Grails 3 project name is written with snake case HOT 2
- New properties to add all templates to a single module
- Release 2.4.0 HOT 6
- assets.configOptions.angular is not found when application is run in dev environment (no war)) HOT 1
- CRLF not supported in templates HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular-template-asset-pipeline.