cgross / generator-cg-angular

Yeoman generator for Enterprise Angular projects.
MIT License
592 stars 198 forks source link

bug: controller-methods executes twice #82

Closed adnasa closed 10 years ago

adnasa commented 10 years ago

Controller-methods executes twice when using the Angular ui-router

Consider the following template (partial):

<div class="col-md-12" ng-controller="HomeCtrl">
</div>

And the following configuration:

    $stateProvider.state('home', {
        url: '/home',
        controller: "HomeCtrl",
        templateUrl: 'path-to-home/home.html',
    });

If the usage is angular ui-router, we should omit the ng-controller part from the partial that is generated. I don't know if the problem can be replicated when using the regaular router system.

reference

cgross commented 10 years ago

This generator doesn't add the controller property to routes it generates. If you've added that property then you should remove the ng-controller attribute but I'm not sure why you would do that.

adnasa commented 10 years ago

hmmm.. it must have slipped my mind that I added that property :) closing...