angular-hint icon indicating copy to clipboard operation
angular-hint copied to clipboard

fix: handle angular.bootstrap

Open btford opened this issue 11 years ago • 4 comments

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

btford avatar Jul 12 '14 19:07 btford

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 avatar Jul 14 '14 17:07 ealtenho

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

ealtenho avatar Jul 14 '14 17:07 ealtenho

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 avatar Jul 14 '14 17:07 ealtenho

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

ealtenho avatar Jul 30 '14 15:07 ealtenho