generator-cg-angular | Yeoman generator for Enterprise Angular projects | Generator Utils library
kandi X-RAY | generator-cg-angular Summary
kandi X-RAY | generator-cg-angular Summary
There is a new generator for Angular 1.5, Webpack, npm, SASS, and ES6. Check it out here: Yeoman Generator for Enterprise Angular Projects. This generator follows the Angular Best Practice Guidelines for Project Structure.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of generator-cg-angular
generator-cg-angular Key Features
generator-cg-angular Examples and Code Snippets
Community Discussions
Trending Discussions on generator-cg-angular
QUESTION
I used (Yeoman) generator-cg-angular to scaffold my AngularJS web-app, and I'm trying to run unit tests without using the html2js preprocessor, but alas it looks like I'm missing something.
I changed the folders treeAs per customer request, I moved index.html
, app.js
and app.less
within a folder named app
, so now the folder structure is something like the following:
ANSWER
Answered 2017-Mar-08 at 09:13After a lot of keyboard facerolling, I've come to this solution:
remove that
directive/**/*.html
fromkarma.options.files
task configuration, since a) it's not enforcing project "folders-by-feature" structure and b) instead getting the templates from'<%= ngtemplates.main.dest %>'
it's solid enough, you just need to change thegrunt test
task intogrunt.registerTask('test',['dom_munger:read','ngtemplates','karma:all_tests']);
remove
beforeEach(module('directive/test-directive/test-directive.html'));
fromtest-directive-spec.js
, since it looks like it clashes with the previously describedngtemplates
mechanism, making the template unavaiable;
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install generator-cg-angular
The project will include a ready-made Grunt build that will:. The resulting build loads only a few highly compressed files. The build process uses grunt-dom-munger to pull script references from the index.html. This means that your index.html is the single source of truth about what makes up your app. Adding a new library, new controller, new directive, etc does not require that you update the build file. Also the order of the scripts in your index.html will be maintained when they're concatenated. Importantly, grunt-dom-munger uses CSS attribute selectors to manage the parsing of the script and link tags. Its very easy to exclude certain scripts or stylesheets from the concatenated files. This is often the case if you're using a CDN. This can also be used to prevent certain development scripts from being included in the final build.
Build all the LESS files into one minified CSS file.
Uses grunt-angular-templates to turn all your partials into Javascript.
Uses grunt-ng-annotate to preprocess all Angular injectable methods and make them minification safe. Thus you don't have to use the array syntax.
Concatenates and minifies all Javascript into one file.
Replaces all appropriate script references in index.html with the minified CSS and JS files.
(Optionally) Minifies any images in /img.
Minifies the index.html.
Copies any extra files necessary for a distributable build (ex. Font-Awesome font files, etc).
To prevent a script or stylesheet from being included in concatenation, put a data-concat="false" attribute on the link or script tag. This is currently applied for the livereload.js and less.js script tags.
To prevent a script or link tag from being removed from the finalized index.html, use a data-remove="false" attribute.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page