Open
Conversation
added 5 commits
September 1, 2015 17:18
…and delete mocha tests
…en filename using the -s or --strip-prefix flag
Author
|
Tests will fail until CI switches to jasmine |
Owner
|
There seems to be conflicts after merging pr #7. Could you merge with the latest for this PR? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In response to #5
This feature adds the ability to strip an arbitrary prefix from the input file name.
In our last two projects, we found it difficult to figure out how to strip a prefix from a file name to be placed into the key of the $templateCache.put(). We wished there was a way to simply strip some arbitrary prefix, but that feature did not exist. We saw the -b/--basedir option, but we could not figure out how to use it properly. As a result, we found ourselves having to change directories to the level where the relative path to the file would wind up being what we wanted to see in the key of the $templateCache.put(). This was a drag. It seems others have also had similar issues with the --basedir option. So, we added the ability to strip an arbitrary prefix.
The behavior of the feature is specified in the tests that accompany this pull request.
In short, to strip an arbitrary prefix, run the following:
./path/to/ng-html2js path/to/file.tmpl -s path/to/
this will yield:
$templateCache.put('file.tmpl', 'the-rest-of-the-magic-goodness')