Giter Site home page Giter Site logo

Comments (6)

naxmefy avatar naxmefy commented on July 20, 2024

example:

- appFolder
- - app.js
- - submodule1Folder
- - - submodule1.js
- - - index.tpl.html
- - submodule2Folder
- - - submodule2.js
- - - index.tpl.html

Problem here - index.html in templateCache can only be once...that is a big problem Oo

from angular-template-asset-pipeline.

craigburke avatar craigburke commented on July 20, 2024

Hi @Naxmeify. That's true, within a module you can only have a single index.html template. That's not to say you can't have several index.html templates each in their own functional module though. My projects tend to look like this:

  • myApp
    • common
      • directives.js
      • services.js
      • templates
    • foo
      • module.js
      • controllers.js
      • services.js
      • templates
        • index.tpl.html
    • bar
      • module.js
      • controllers.js
      • services.js
      • templates
        • index.tpl.html

I think you can probably avoid the name collisions, but it's certainly not an unreasonable request. I could add a setting like includeFullPath so the plugin would produce something like this:

angular.module('myApp.foo').run(['$templateCache', function($templateCache) {
    $templateCache.put('/my-app/foo/index.html', '<h1>Foo!</h1>');
}]);

angular.module('myApp.bar').run(['$templateCache', function($templateCache) {
    $templateCache.put('/my-app/bar/index.html', '<h1>Bar!</h1>');
}]);

Would that work?

from angular-template-asset-pipeline.

naxmefy avatar naxmefy commented on July 20, 2024

Something like this would be perfect.

Suggestions:

  • .html can be removed
  • the module name could be infront file name separated with dot (module.index.html)
  • a new trick for templatecache to separate templates per module xD

from angular-template-asset-pipeline.

craigburke avatar craigburke commented on July 20, 2024

@Naxmeify ok, cool. I'll include this option in the next release (hopefully sometime this week).

I appreciate the feedback. I'm going back and forth on the .html part, but I'm pretty set on the path instead of module name in the name.

I think in using the path that it's a bit more obvious where the template file is (or where it should be in the case of a misspelled file name).

from angular-template-asset-pipeline.

craigburke avatar craigburke commented on July 20, 2024

Ok, I just pushed a new release. The new config setting is includePathInName.

Give version 1.4.0 a spin and see if it does the trick for you.

from angular-template-asset-pipeline.

naxmefy avatar naxmefy commented on July 20, 2024

great

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.