-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modifying the path #55
Comments
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 |
So, in Require (not React), there is a function When given a string like 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 All I need is a hook to prepend something to the url after it has been normalized. My PR adds Does this clarify the issue a bit? |
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 |
@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. |
Also, fwiw, the grunt cousin to this library plays nicely with require.toUrl generated paths. |
I am having the same issue as paradox41. However not using requirejs but the new angular router. Therefore requesting reopening this issue. |
I have a fork available with my fix that I have been using successfully for Sent from my Moto X
|
@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 :-) |
Currently, any path that contains
..
or.
will be rewritten to omit those becausepath.join()
andpath.normalize()
do this.This is inconvenient when using RequireJS's require.toUrl() as it will prepend
./
to the generated URLs (since require has to know where the file is). These are effectively the keys that are then used to look up the appropriate template by angular, hence the need to keep this path the way it is.Do you have any suggestions for how to handle this? I have attempted using both the
base
androot
options, but both of these get normalized.If I were to submit a PR for this, I would probably add a hook to modify the url one last time before it is actually added to the template file, thereby avoiding the whole normalization problem. But I am not sure whether or not this is the path you'd like to take.
The text was updated successfully, but these errors were encountered: