Comments (12)
This will be a little bit tricky cause the JSON.stringify
method wraps everything in double quotes. Do you know any other library for this problem? It would be nice if I could also convert Date
objects and keep them as Date
.
from grunt-ng-constant.
I don't know any :( Can easily bypass this issue by ignoring the generated file.
Great work though!
from grunt-ng-constant.
That would be my advice too ;)
I will keep this open, maybe I find an alternative.
from grunt-ng-constant.
I think valid JSON should have double quotes. I set my jshint to ignore all json files and it's fine.
I would close this issue myself but I'll leave the decision to you in case you want to add this feature at some point.
from grunt-ng-constant.
That's right it is valid JSON, but you are not limited to JSON in an angular constant module.
from grunt-ng-constant.
True but I prefer it. I work on a medium to large app with a lot of constants spread over multiple files. I do not find it proper to define constant values in my Gruntfile. Unless I'm missing something here...
from grunt-ng-constant.
Nice to hear that my plugin is useful for others :)
Sure the JSON option should always be the default, but another option could be useful too.
from grunt-ng-constant.
Thanks for everything! I'll keep an eye out on this issue to see if the generated files still fail jshint.
I'll do my best to help in the meantime.
from grunt-ng-constant.
I just sent a pull request to add a singlequote option. Check it out and let me know if that might be a possible solution.
from grunt-ng-constant.
@werk85 is everything alright with the pull request?
from grunt-ng-constant.
Is there any reason why "singlequote" didn't get pulled into master?
A work-around for this ...
ngconstant: {
options: {
space: ' ',
wrap: '/*jshint quotmark:double*/\n\n"use strict";\n\n {%= __ngModule %}',
name: 'myConfig'
},
from grunt-ng-constant.
Read #20 for more informations.
from grunt-ng-constant.
Related Issues (20)
- Unable to write "undefined" file HOT 4
- Add space option for backwards compability HOT 1
- Set value for a constant file with differents targets HOT 1
- Release 0.5.0 HOT 4
- Constant works only with string values, no support for functions HOT 3
- support function type HOT 8
- Release 1.0.0 HOT 3
- Objects and Function as constatnt. HOT 1
- DOCS: The example doesn't work well for generated constant value files HOT 3
- Pull Constants from .json File? HOT 1
- Usage in index.html HOT 3
- Is it possible to write a constant to an already existing module and not create a new one? HOT 1
- Add useStrict option to configuration HOT 6
- Dynamic constants HOT 1
- possible to add multiple ngconstants to a task? HOT 3
- options.deps in false by default HOT 1
- Update lodash please
- will the config file be built in main js file or will be inserted in index.html file? HOT 5
- Issue with no-shadow-restricted-names ESLint rule HOT 1
- Git vulnerability - Required updated version of merge plugin to ^1.2.1 HOT 1
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 grunt-ng-constant.