3.0.1 • Published 4 years ago
gulp-ng-const v3.0.1
gulp-ng-const
Generates an angular.js 'constant' object from a JSON file.
This was originally created for a project that uses enums defined in an API that were required in an angular.js app
Arguments
Param | Value |
---|---|
input | JSON file to convert |
moduleName | Angular.js module name |
constantName | Angular.js constant name to be created |
indentSize | default 4 |
output | output filename |
Example
gulp-ng-const --input=generated-json.json --output=generated.js --module=myApp
would generate a file with the following contents
(function() {
angular.module("myApp").constant("GENERATED_CONSTANTS", {
// your JSON content here
});
})();