Comments (6)
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.
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
- common
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.
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.
@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.
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.
great
from angular-template-asset-pipeline.
Related Issues (20)
- Line breaks are not formatted properly HOT 16
- angular-template-asset-pipeline 2.0.1 does not appear to be working HOT 14
- 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.