Giter Site home page Giter Site logo

Comments (14)

craigburke avatar craigburke commented on July 20, 2024

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.

a01fe avatar a01fe commented on July 20, 2024

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.

craigburke avatar craigburke commented on July 20, 2024

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.

a01fe avatar a01fe commented on July 20, 2024

Yep, it works for me with an explicit require.

from angular-template-asset-pipeline.

craigburke avatar craigburke commented on July 20, 2024

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.

craigburke avatar craigburke commented on July 20, 2024

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.

a01fe avatar a01fe commented on July 20, 2024

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.

craigburke avatar craigburke commented on July 20, 2024

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.

craigburke avatar craigburke commented on July 20, 2024

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.

ctoestreich avatar ctoestreich commented on July 20, 2024

This is still an issue. Can you update docs to say something about the html vs htm issue?

from angular-template-asset-pipeline.

craigburke avatar craigburke commented on July 20, 2024

@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.

ctoestreich avatar ctoestreich commented on July 20, 2024

@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.

craigburke avatar craigburke commented on July 20, 2024

@ctoestreich yeah, that's a good idea. I've made the change to the docs.

from angular-template-asset-pipeline.

craigburke avatar craigburke commented on July 20, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.