Giter Site home page Giter Site logo

Comments (7)

craigburke avatar craigburke commented on July 20, 2024

Hi @JCDubs: give the following a try. Use tpl.htm instead of tpl.html (currently only the former is supported) but supporting both is on my list of issues to get resolved.

Also, since the path to the template file has to match the module name, I would move your tpl.htm file to /assets/javascripts/header-module/templates.

Does that help?

from angular-template-asset-pipeline.

JCDubs avatar JCDubs commented on July 20, 2024

@craigburke, I tried your suggestions above but it didn't help. I tried placing the test-header-template.tpl.htm file into the assets/javascripts/header-module/templates/ directory. I also tried placing the template file into the assets/javascripts/directives/templates/ directory as well but no joy. Im not sure what else could solve the problem.

from angular-template-asset-pipeline.

craigburke avatar craigburke commented on July 20, 2024

@JCDubs alright I'll pull the project and see if I can get it working.

from angular-template-asset-pipeline.

craigburke avatar craigburke commented on July 20, 2024

Hi @JCDubs take a look at my pull request, that appears to be working. When I browse to http://localhost:8080/anggrails/assets/header-module/templates/test-header-template.js

I see this:

angular.module('headerModule').run(['$templateCache', function($templateCache) {
    $templateCache.put('test-header-template.htm', '<h1>The Template File Works</h1>');
}]);

from angular-template-asset-pipeline.

craigburke avatar craigburke commented on July 20, 2024

One thing to keep in mind is that the path that the templates are in matters. If you decide to use the plugin I'd recommend grouping your files by the module name instead of type of object.

/javascripts/module1/controllers.js
/javascripts/module2/controllers.js

instead of

/javascripts/controllers/module1.js
/javascripts/controllers/module2.js

from angular-template-asset-pipeline.

JCDubs avatar JCDubs commented on July 20, 2024

Nice one @craigburke, I have merged your pull request and it works brilliantly. I will take your recommendations for structural standards forward in my angular development and I look forward to implementing angular in the front end of all of my apps, cheers.

from angular-template-asset-pipeline.

craigburke avatar craigburke commented on July 20, 2024

@JCDubs great! Happy to help! 😃

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.