Socket
Socket
Sign inDemoInstall

gen-ng-component

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    gen-ng-component

A micro cli app to generate angularjs component according to John Papa's styleguide


Version published
Maintainers
1
Install size
7.11 kB
Created

Readme

Source

gen-ng-component

Build Status

This micro-app generates an angularjs component according to John Papa's styleguide.

Installation

npm -g install gen-ng-component

Usage

gen-ng-component {moduleName} {componentName} {path}

Example

gen-ng-component app.main detailsList

^^ This line will generate the following files:

detailsList
    ├── detailsList.component.js
    ├── detailsList.controller.js
    ├── detailsList.html
    └── detailsList.module.js

detailsList.component.js

/**
 * @desc detailsList component
 * @namespace Components
 */
(function() {

    'use strict';
    
    angular
        .module('app.main.detailsList')
        .component('detailsList', {
            bindings: {
            },
            templateUrl: 'detailsList/detailsList.html',
            controller: 'DetailsListController as vm',
        });

})();

detailsList.controller.js

/**
 * @desc detailsList component
 * @namespace Controllers
 */
(function() {

    'use strict';
    
    angular
        .module('app.main.detailsList')
        .controller('DetailsListController', DetailsListController);

    /**
     * @name DetailsListController
     * @desc detailsList controller
     * @constructor
     * @ngInject
     */
    function DetailsListController() {
        const vm = this;
    }

})();

detailsList.html

<!-- detailsList component -->
<section class="details-list">
    <!-- detailsList contents -->
</section>
<!-- /detailsList component -->

detailsList.module.js

/**
 * @desc detailsList component
 * @namespace Modules
 */
(function() {

    'use strict';
    
    angular
        .module('app.main.detailsList', []);

})();

Keywords

FAQs

Last updated on 01 Nov 2017

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc