schmuli / AngularBundleOrderer

A BundleOrderer implementation for ordering Angular application files

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AngularBundleOrderer

A BundleOrderer implementation for ordering Angular application files

File Names

The orderer expects files to be named using the dot notation

  • app.controller.js
  • logger.service.js
  • skip.filter.js
  • clock.directive.js

Additionally, each folder should contain a module.js file, which can optionally contain the module name too: app.module.js.

Any files that don't match one of the known types: service, controller, directive, filter or module, will not be sorted and will remain at the original position.

Note that the orderer does not diffrentiate between services and factories, these should both be marked as .service.

Sort Order

The orderer currently assumes that module files should appear last, as the module file will include all it's components:

angular.module('app', [])
    .service('logger', [LoggerService])
    .controller('AppController', [AppController])
    .filter('skip', skipFilter)
    .directive('clock', clockDirective);

Usage

In the BundleConfig.cs file, you can use the helper extension method, .AddAngularApp.

bundles.AddAngularApp("~/bundles/app", "~/Scripts/App");

The first parameter is the virtual name of the bundle, the second parameter is the Directory containing the application angular files.

About

A BundleOrderer implementation for ordering Angular application files

License:MIT License


Languages

Language:C# 100.0%