angular / angular-hint

run-time hinting for AngularJS applications
362 stars 45 forks source link

fix: handle angular.bootstrap #21

Open btford opened 10 years ago

btford commented 10 years ago

Our current approach only lets us instrument apps that use ng-app. We also need to patch angular.bootstrap

ealtenho commented 10 years ago

What syntax did you have in mind for patching angular.bootstrap? My first thought would be allowing apps using angular.bootstrap to load modules when they call angular.bootstrap, for example:

    var app = angular.module('manualBootstrapHint', [])
    .controller('ManualController', function() {
      var element = document.getElementById('test');
    });
    angular.bootstrap(document, ['manualBootstrapHint', 'ngHintDom']);

This approach works with the current logic.

Are expecting users instead to use the same syntax as when using ng-app?

ealtenho commented 10 years ago

See: https://github.com/angular/angular-hint/commit/e234ca5dcee486b8c0649fbe713a49632abdfa93

ealtenho commented 10 years ago

Okay, I added an alternative example for angular.bootstrap where I include the ng-hint directive in the commit referenced above. In this example both modules also load correctly. Is this not expected behavior?

ealtenho commented 9 years ago

@btford I think I'm still not understanding how to test for this issue. Any advice?