
Company News
Socket Has Acquired Secure Annex
Socket has acquired Secure Annex to expand extension security across browsers, IDEs, and AI tools.
generator-ng-super
Advanced tools
Alot of work has been shamelessly pulled in through John Papa's course of Angular JS Patterns: Clean Code and its corresponding Angular JS Style Guide.
Pre-requisites:
To install yeoman:
$ npm install yo -g
To install Bower
$ npm install bower -g
To install Compass**
$ gem install compass
** Make sure you have Ruby installed on your machine ** https://www.ruby-lang.org/en/documentation/installation/
To install generator-ng-super:
$ npm install -g generator-ng-super
Finally, initiate the generator:
$ mkdir superApp
$ cd superApp
$ yo ng-super
Install project dependencies:
$ cd superApp
$ npm install
$ bower install
Run $ grunt server to run the application.
βββ app
βΒ Β βββ fonts
βΒ Β βΒ Β βββ Kelvetica Nobis.otf
βΒ Β βββ images
βΒ Β βΒ Β βββ welcome
βΒ Β βΒ Β βββ super-logo.jpg
βΒ Β βββ index.html
βΒ Β βββ src
βΒ Β βΒ Β βββ app.module.js
βΒ Β βΒ Β βββ common
βΒ Β βΒ Β βΒ Β βββ common.module.js
βΒ Β βΒ Β βββ core
βΒ Β βΒ Β βΒ Β βββ core.module.js
βΒ Β βΒ Β βΒ Β βββ restangular.config.js
βΒ Β βΒ Β βΒ Β βββ httpStatus.constant.js
βΒ Β βΒ Β βΒ Β βββ router.config.js
βΒ Β βΒ Β βββ welcome
βΒ Β βΒ Β βββ welcome.controller.js
βΒ Β βΒ Β βββ welcome.html
βΒ Β βΒ Β βββ welcome.module.js
βΒ Β βββ styles
βΒ Β βββ css
βΒ Β βΒ Β βββ main.css
βΒ Β βββ main.scss
βΒ Β βββ partials
βΒ Β βββ _skin.scss
βΒ Β βββ _welcome.scss
βββ bower.json
βββ configLoader.js
βββ gruntfile.js
βββ package.json
βββ tasks
βΒ Β βββ bump.js
βΒ Β βββ clean.js
βΒ Β βββ compass.js
βΒ Β βββ concurrent.js
βΒ Β βββ connect.js
βΒ Β βββ copy.js
βΒ Β βββ html2js.js
βΒ Β βββ karma.js
βΒ Β βββ ngAnnotate.js
βΒ Β βββ replace.js
βΒ Β βββ usemin.js
βΒ Β βββ useminPrepare.js
βΒ Β βββ watch.js
βΒ Β βββ wiredep.js
βββ tests
βββ welcome
βββ welcome.controller.js
Generates an Angular Controller for the provided Module
yo ng-super:controller dashboard.user
Produces: app/src/dashboard/user.controller.js:
/**
* @ngdoc controller
* @name app.dashboard.controller:User
* @description < description placeholder >
*/
(function(){
'use strict';
angular
.module('app.dashboard')
.controller('User', User);
/* @ngInject */
function User(){
var vm = this;
vm.testFunction = testFunction;
/////////////////////
/**
* @ngdoc method
* @name testFunction
* @param {number} num number is the number of the number
* @methodOf app.dashboard.controller:User
* @description
* My Description rules
*/
function testFunction(num){
console.info('This is a test function');
}
}
}());
Generates an Angular Directive for the provided Module
yo ng-super:directive common.kuSubmit
Produces: app/src/common/kuSubmit.directive.js:
/**
* @ngdoc directive
* @name app.common.directive:kuSubmit
* @scope true
* @param {object} test test object
* @restrict E
*
* @description < description placeholder >
*
*/
(function(){
'use strict';
angular
.module('app.common')
.directive('kuSubmit', kuSubmit);
/* @ngInject */
function kuSubmit(){
return {
link: link,
restrict: 'E',
template: '<div></div>',
scope: {
test: '='
}
};
/////////////////////
function link(scope, elem, attrs){
console.info('This is a link function of the directive');
}
}
}());
Generates an Angular Factory for the provided Module
yo ng-super:factory common.calendar
Produces: app/src/common/calendar.factory.js:
/**
* @ngdoc service
* @name app.common.calendar
* @description < description placeholder >
*/
(function(){
'use strict';
angular
.module('app.common')
.factory('calendar', calendar);
/* @ngInject */
function calendar(){
return {
testFunction: testFunction
};
////////////////////
/**
* @ngdoc
* @name app.common.calendar#testFunction
* @methodOf app.common.calendar
*
* @description < description placeholder >
* @example
* <pre>
* calendar.testFunction(id);
* </pre>
* @param {int} entity id
*/
function testFunction(id){
console.info('This is a test function');
}
}
}());
Generates an Angular Constant for the provided Module
yo ng-super:constant common.errorMessages
Produces: app/src/common/errorMessages.constant.js:
/**
* @ngdoc object
* @name app.common.constant:errorMessages
* @description < description placeholder >
* @example
<pre>
angular.module("someModule", [])
.config(configuration);
function configuration(errorMessages, someProvider){
//use the injected constant
};
</pre>
*/
(function(){
'use strict';
var errorMessages = {
someConstant: 'hasSomeValue'
};
angular
.module('app.common')
.constant('errorMessages', errorMessages);
}());
Generates an Angular Value for the provided Module
yo ng-super:value core.appId
Produces: app/src/core/appId.value.js:
/**
* @ngdoc object
* @name app.core.constant:appId
* @description < description placeholder >
* @example
<pre>
angular.module("someModule", [])
.controller("some", controller);
function controller(appId, someService){
var vm = this;
//use the injected constant
};
</pre>
*/
(function(){
'use strict';
var appId = {
someValue: 'obviouslyHasSomeValue'
};
angular
.module('app.core')
.value('appId', appId);
}());
Generates an Angular Filter for the provided Module
yo ng-super:filter common.currency
Produces: app/src/common/currency.filter.js:
/**
* @ngdoc filter
* @name app.common.filer:currency
* @description < description placeholder >
* @param {object} input object to be filtered
* @returns {object} < returns placeholder >
*/
(function(){
'use strict';
angular
.module('app.common')
.filter('currency', currency);
/* @ngInject */
function currency(){
return function (input){
return 'currency filter: ' + input;
};
}
}());
Generates an Angular Module
yo ng-super:feature talks
Produces: app/src/talks/talks.module.js:
/**
* @ngdoc overview
* @name app.talks
* @description < description placeholder >
*/
(function(){
'use strict';
angular
.module('app.talks', [])
.config(configuration);
/* @ngInject */
function configuration($stateProvider){
//add your state mappings here
//$stateProvider
// .state('Welcome', {
// url:'/welcome',
// templateUrl:'src/welcome/welcome.html',
// controller: 'WelcomeCtrl as vm'
// }
//);
}
}());
Generates an HTML view
yo ng-super:view dashboard.performance
Produces: app/src/dashboard/performance.html:
<div> this a a sample view for dashboard.performance </div>
Generated app would contain jshint and jscs configurations. Make sure your editor is configured to take advantage of both styling and linting.
$ grunt serverPops up a development environment with HTML, CSS and JS Livereload
$ grunt testRuns all unit tests on Karma
$ grunt buildCreates a dist containing a distribute-able Angular App
$ grunt bumpBump application version and goodies, details at grunt-bump
$ grunt ngdocsGenerates documentation from the ngdoc declared in the Angular source code
Following packages are pre-configured:
generator-ng-super is a heavily opinionated project that has been initiated to contain mix of best practices learned through courses and expirience.
It also contains a mix of packages which are best in the business pre-configured into the application structure like Angular UI's Twitter Bootstrap Directives, Angular UI's UI-Router (replacing ngRoute) and Martin Gonto's Restangular (replacing $http and $resource).
The main purpose of generator-ng-super was to encapsulate the best from the industry experts and make it ready for use.
The directory structure has been chosen to ease readability and search for code while keeping the directory structure flat. It corresponds to John Papa's LIFT principle of code organization.
generator-ng-super will provide a complete running Angular JS application with all the goodies like sample code, tests and packages setup in a few mins. Each sub-generator for the components provides sample code enabling the developer to get straight down to business of writing code, all the other setup configuration and code is taken care of by the generator.
UI-Router contains all the missing features from the ngRouter. Visit Angular UI Router for further insight.
Restangular provides tons of goodies through which you can setup your HTTP requests in a very intuitive way. Visit Restangular for further insight.
MIT
FAQs
Yeoman generator
The npm package generator-ng-super receives a total of 0 weekly downloads. As such, generator-ng-super popularity was classified as not popular.
We found that generator-ng-super demonstrated a not healthy version release cadence and project activity because the last version was released a year ago.Β It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket has acquired Secure Annex to expand extension security across browsers, IDEs, and AI tools.

Research
/Security News
Socket is tracking cloned Open VSX extensions tied to GlassWorm, with several updated from benign-looking sleepers into malware delivery vehicles.

Product
Reachability analysis for PHP is now available in experimental, helping teams identify which vulnerabilities are actually exploitable.