Comments (8)
Not sure I understand your problem fully. Perhaps you can provide a small example of what you are trying to achieve?
Can't see how this plugin would work differently if you were to use React together with Angular. You can't use relative root urls starting with /
? E.g. /some/fancy/template.html
from gulp-angular-templatecache.
So, in Require (not React), there is a function toUrl()
which will automatically generate the path to a given file.
When given a string like require.toUrl('./foo/bar/_baz.html')
, require will begin looking for _baz.html
starting from the current directory.
This means that the url generated - and the url angular uses in the template cache - begins with ./
The problem I was having with this task is that .
and ..
are stripped out of the url, meaning angular will never find the template in the cache since it begins with a .
All I need is a hook to prepend something to the url after it has been normalized. My PR adds urlPrefix
. I have been using this locally for the last week and it has worked fine.
Does this clarify the issue a bit?
from gulp-angular-templatecache.
Thanks for the explanation! This sounds like an edge case to me, so we'll close for now but re-open if more users are requesting something similar. thx
from gulp-angular-templatecache.
This sounds like an edge case to me
@miickel Quite the opposite actually.
@Paradox41 is describing a requirejs + angular best-practice. Using require.toUrl gives you all of the benefits of module relative pathing (critical for larger, multi-person projects) while avoiding the headaches involved in using absolute paths.
Refactoring a large project that uses absolute path references for partials is a very special type of hell.
I'd be interested in seeing this reopened, or really any solution that allows continued usage of require.toUrl.
from gulp-angular-templatecache.
Also, fwiw, the grunt cousin to this library plays nicely with require.toUrl generated paths.
from gulp-angular-templatecache.
I am having the same issue as paradox41.
However not using requirejs but the new angular router.
Need the ./ in the beginning but the join() method removes them.
Therefore requesting reopening this issue.
from gulp-angular-templatecache.
I have a fork available with my fix that I have been using successfully for
quite some time. Feel free to check it out.
Sent from my Moto X
On May 5, 2015 12:48 PM, "Sebastian Schirmer" [email protected]
wrote:
I am having the same issue as paradox41.
However not using requirejs but the new angular router.
Need the ./ in the beginning but the join() method removes them.Therefore requesting reopening this issue.
—
Reply to this email directly or view it on GitHub
#55 (comment)
.
from gulp-angular-templatecache.
@Paradox41 Thank you, checked it out and this will work!
@miickel This should be added to this repo as well. By the way, thanks for this great module :-)
from gulp-angular-templatecache.
Related Issues (20)
- Template Body readme instructions result in incorrect string escaping
- Make concatenation an option HOT 1
- Angular Arguments HOT 1
- Crash with a cryptic error message when a folder container a dot HOT 9
- EPERM: operation not permitted HOT 1
- Don't use a logical or for setting header and footer. HOT 9
- Replace deprecated dependency gulp-util
- Remove deprecated gulp-util by updating gulp-header & gulp-footer HOT 3
- Question: Is it possible to make template urls relative? HOT 8
- Sort output by URI HOT 1
- Fix Security Vulnerabilities HOT 1
- Use ES2015 HOT 4
- Minification is stripping the basic IIFE wrapper from the cached templates HOT 4
- Leading slash added to filenames under gulp 4 HOT 18
- Security Issue: Removing dependency `event-stream` HOT 2
- Error: ENOENT: no such file or directory, open 'target/tmp/templates.js' HOT 1
- Buffer() is deprecated due to security issues.
- Update to NodeJS 8
- npm ERR! Unexpected end of JSON input while parsing near '...0.2"},"dist":{"shasum' HOT 1
- Prototype Pollution security vulnerability 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 gulp-angular-templatecache.