klei / gulp-angular-filesort

Automatically sort AngularJS app files depending on module definitions and usage
MIT License
132 stars 46 forks source link

File with no dependency could be set at the begining #46

Closed mpoiriert closed 1 year ago

mpoiriert commented 8 years ago

I am declaring class standalone and then using them in angular.

Example:

(function() {
    'use strict';

    angular
        .module('application')
        .config(routerConfig);

    /**
     * @ngInject
     * @param $stateProvider
     * @param $urlRouterProvider
     */
    function routerConfig($stateProvider, $urlRouterProvider) {
        $stateProvider
            .state('home', {
                url: '/',
                templateUrl: 'app/Application/Resources/views/home.html',
                controller: Application.Controller.HomeController,
                controllerAs: 'controller'
            });
        $urlRouterProvider.otherwise('/');
    }

})();

The class Application.Controller.HomeController is declare in another file.

Problem is that the file might be include after the state declaration.

I made test to change this on the version 1.1.1 and it worked properly. Unfortunately I didn't see that the master branch have "changed" that much so I cannot do a pull request of that change. But I can do it if you think it's needed.