Skip to content
This repository has been archived by the owner on Jul 28, 2020. It is now read-only.

Paden/eastApp

Repository files navigation

eastApp

Install

npm install && bower install

Sub-Generators

Note: Generators are to be run from the root directory of your app.

Route

Generates a controller and view, and configures a route in app/scripts/app.js connecting them.

Example:

yo angular:route myroute

Produces app/scripts/controllers/myroute.js:

angular.module('myMod').controller('MyrouteCtrl', function ($scope) {
  // ...
});

Produces app/views/myroute.html:

<p>This is the myroute view</p>

Controller

Generates a controller in app/scripts/controllers.

Example:

yo angular:controller user

Produces app/scripts/controllers/user.js:

angular.module('myMod').controller('UserCtrl', function ($scope) {
  // ...
});

Directive

Generates a directive in app/scripts/directives.

Example:

yo angular:directive myDirective

Produces app/scripts/directives/myDirective.js:

angular.module('myMod').directive('myDirective', function () {
  return {
    template: '<div></div>',
    restrict: 'E',
    link: function postLink(scope, element, attrs) {
      element.text('this is the myDirective directive');
    }
  };
});

Filter

Generates a filter in app/scripts/filters.

Example:

yo angular:filter myFilter

Produces app/scripts/filters/myFilter.js:

angular.module('myMod').filter('myFilter', function () {
  return function (input) {
    return 'myFilter filter:' + input;
  };
});

View

Generates an HTML view file in app/views.

Example:

yo angular:view user

Produces app/views/user.html:

<p>This is the user view</p>

Service

Generates an AngularJS service.

Example:

yo angular:service myService

Produces app/scripts/services/myService.js:

angular.module('myMod').service('myService', function () {
  // ...
});

You can also do yo angular:factory, yo angular:provider, yo angular:value, and yo angular:constant for other types of services.

Decorator

Generates an AngularJS service decorator.

Example:

yo angular:decorator serviceName

Produces app/scripts/decorators/serviceNameDecorator.js:

angular.module('myMod').config(function ($provide) {
    $provide.decorator('serviceName', function ($delegate) {
      // ...
      return $delegate;
    });
  });

Add to Index

By default, new scripts are added to the index.html file. However, this may not always be suitable. Some use cases:

  • Manually added to the file
  • Auto-added by a 3rd party plugin
  • Using this generator as a subgenerator

To skip adding them to the index, pass in the skip-add argument:

yo angular:service serviceName --skip-add

Bower Components (to be updated...)

The following packages are always installed by the app generator:

  • angular
  • angular-mocks
  • angular-scenario

The following additional modules are available as components on bower, and installable via bower install:

  • angular-strap
  • jquery
  • bootstrap
  • angular-motion
  • angular-route
  • angular-animate
  • angular-google-maps
  • angular-qrcode
  • angular-webstorage
  • angular-resource
  • angular-sanitize
  • angular-scrollto

All of these can be updated with bower update as new versions of AngularJS are released.

Configuration

Yeoman generated projects can be further tweaked according to your needs by modifying project files appropriately.

Testing

Running grunt test will run the unit tests with karma.

License

CC BY NC SA Licensing This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/4.0/.

About

Art Attack - Hackathon submittion for http://hackingeast.challengepost.com/

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published