-
Notifications
You must be signed in to change notification settings - Fork 38
Custom targets with corresponding injector tag #21
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
base: master
Are you sure you want to change the base?
Conversation
|
Good idea! I would prefer if this is an option, it will break a lot of peoples configurations otherwise. Maybe like so: injector: {
options: {
groupByTarget: true
},
myControllers: {
files: {
'<%= yeoman.app %>/index.html': ['<%= yeoman.app %>/scripts/controllers/**/*.js']
}
},
myServices: {
files: {
'<%= yeoman.app %>/index.html': ['<%= yeoman.app %>/scripts/services/**/*.js']
}
}
}And if the |
|
I agree, this feature is now configurable. |
|
Please update the README and add some tests. |
…te name.) Tests added Readme updated
|
I added some tests and updated the readme file. Please check if my spelling is correct, English is not my native language :) |
|
+1 |
|
Isn't this already possible using the starttag option? I think the only issue is that the output file gets clobbered by other targets. The above should allow you to do something like: However, there seems to be an issue with multiple targets directing to the same file where it clobbers previous changes (in the above example only injector:app:css gets injected when running ...or it is entirely possible I'm mis-understanding the scenario. |
|
Ignore my stupidity w/ the previous comment... 😄 In my case it is re-fetching the template for each target & clobbering the previous target's output. This is likely by design since it is possible one might want to use the same template to inject different data to different files. I wouldn't expect injector to know to pipe the output from one target to the next. That said, I was able to resolve the issue by piping the output to a temp file & using that as the template for the next target |
Merge upstream master into project
|
Hi All, This would be awesome because those comments would be hidden when viewing the source code. I hope this meets with more approval 😄 |
|
ping, can i close it or you would want to merge this and is safe to merge? |
As mentioned in #20 it might be a good idea to group files by the target name instead of the file extension.
This allows you to make multiple 'groups' of injected files.
Gruntfile
HTML
If you want, it's also possible to inject multiple file types in a single group..