J'ai une application angularjs, fonctionnant parfaitement dans Chrome et Firefox et même Edge! Bien que pas sur IE11.Angularjs Impossible d'instancier le module WebApp en raison de: Erreur: à la fonction Anonyme
J'ai essayé emballer mes init.js comme suit:
var = webApp angular.module ('WebApp', [ 'ngRoute', 'ui.bootstrap', '-mandrill angulaire', « firebase ']);
(function() {
angular.module('WebApp').run(function($rootScope,$timeout) {
$timeout(function(){
$rootScope.$on('$routeChangeSuccess', function(ev, data) {
if (data && data.controller) {
var controller = data.controller;
controller = controller.charAt(0).toLowerCase() + controller.slice(1);
controller = controller.replace(/Controller/g, '');
$rootScope.controller = controller;
}
});
}, 100);
}).$inject = ['$rootScope'];
}).bind(window);
J'ai aussi essayé emballer tous mes contrôleurs comme:
(function (angulaire) { "use strict",
// contrôleur ici } (window.angular))
Quelqu'un d'autre a des idées? Merci!
EDITED! - Erreur supplémentaire :) piles -
HTML1300: Navigation occurred.
localhost:8000
SCRIPT1006: Expected ')'
angular-mandrill.js (1,597)
SCRIPT5022: [$injector:modulerr] http://errors.angularjs.org/1.5.5/$injector/modulerr?p0=WebApp&p1=Error%3A%20%5B%24injector%3Amodulerr%5D%20http%3A%2F%2Ferrors.angularjs.org%2F1.5.5%2F%24injector%2Fmodulerr%3Fp0%3Dangular-mandrill%26p1%3DError%253A%2520%255B%2524injector%253Anomod%255D%2520http%253A%252F%252Ferrors.angularjs.org%252F1.5.5%252F%2524injector%252Fnomod%253Fp0%253Dangular-mandrill%250A%2520%2520%2520at%2520Anonymous%2520function%2520(http%253A%252F%252Flocalhost%253A8000%252Fassets%252Fexternal%252Fangular%252Fangular.min.js%253A25%253A229)%250A%2520%2520%2520at%2520b%2520(http%253A%252F%252Flocalhost%253A8000%252Fassets%252Fexternal%252Fangular%252Fangular.min.js%253A24%253A263)%250A%2520%2520%2520at%2520Anonymous%2520function%2520(http%253A%252F%252Flocalhost%253A8000%252Fassets%252Fexternal%252Fangular%252Fangular.min.js%253A25%253A13)%250A%2520%2520%2520at%2520Anonymous%2520function%2520(http%253A%252F%252Flocalhost%253A8000%252Fassets%252Fexternal%252Fangular%252Fangular.min.js%253A39%253A372)%250A%2520%2520%2520at%2520q%2520(http%253A%252F%252Flocalhost%253A8000%252Fassets%252Fexternal%252Fangular%252Fangular.min.js%253A7%253A353)%250A%2520%2520%2520at%2520g%2520(http%253A%252F%252Flocalhost%253A8000%252Fassets%252Fexternal%252Fangular%252Fangular.min.js%253A39%253A222)%250A%2520%2520%2520at%2520Anonymous%2520function%2520(http%253A%252F%252Flocalhost%253A8000%252Fassets%252Fexternal%252Fangular%252Fangular.min.js%253A39%253A380)%250A%2520%2520%2520at%2520q%2520(http%253A%252F%252Flocalhost%253A8000%252Fassets%252Fexternal%252Fangular%252Fangular.min.js%253A7%253A353)%250A%2520%2520%2520at%2520g%2520(http%253A%252F%252Flocalhost%253A8000%252Fassets%252Fexternal%252Fangular%252Fangular.min.js%253A39%253A222)%250A%2520%2520%2520at%2520bb%2520(http%253A%252F%252Flocalhost%253A8000%252Fassets%252Fexternal%252Fangular%252Fangular.min.js%253A43%253A240)%0A%20%20%20at%20Anonymous%20function%20(http%3A%2F%2Flocalhost%3A8000%2Fassets%2Fexternal%2Fangular%2Fangular.min.js%3A40%3A25)%0A%20%20%20at%20q%20(http%3A%2F%2Flocalhost%3A8000%2Fassets%2Fexternal%2Fangular%2Fangular.min.js%3A7%3A353)%0A%20%20%20at%20g%20(http%3A%2F%2Flocalhost%3A8000%2Fassets%2Fexternal%2Fangular%2Fangular.min.js%3A39%3A222)%0A%20%20%20at%20Anonymous%20function%20(http%3A%2F%2Flocalhost%3A8000%2Fassets%2Fexternal%2Fangular%2Fangular.min.js%3A39%3A380)%0A%20%20%20at%20q%20(http%3A%2F%2Flocalhost%3A8000%2Fassets%2Fexternal%2Fangular%2Fangular.min.js%3A7%3A353)%0A%20%20%20at%20g%20(http%3A%2F%2Flocalhost%3A8000%2Fassets%2Fexternal%2Fangular%2Fangular.min.js%3A39%3A222)%0A%20%20%20at%20bb%20(http%3A%2F%2Flocalhost%3A8000%2Fassets%2Fexternal%2Fangular%2Fangular.min.js%3A43%3A240)%0A%20%20%20at%20c%20(http%3A%2F%2Flocalhost%3A8000%2Fassets%2Fexternal%2Fangular%2Fangular.min.js%3A21%3A17)%0A%20%20%20at%20yc%20(http%3A%2F%2Flocalhost%3A8000%2Fassets%2Fexternal%2Fangular%2Fangular.min.js%3A21%3A325)%0A%20%20%20at%20ee%20(http%3A%2F%2Flocalhost%3A8000%2Fassets%2Fexternal%2Fangular%2Fangular.min.js%3A20%3A156)
angular.min.js (40,25)
rendered http://localhost:8000/assets/css/style.less successfully.
css for http://localhost:8000/assets/css/style.less generated in 1641ms
less has finished. css generated in 1641ms
Hey stej4n, merci pour vos commentaires! Malheureusement, n'a pas semblé fonctionner. Toujours obtenir SCRIPT5022: [$ injector: modulerr] http://errors.angularjs.org/1.5.5/$injector/modulerr?p0=WebApp – kierandes
Avez-vous toujours la même erreur avec ce code? Parce que vous n'avez pas injecté ''$ timeout''. Pourriez-vous fournir la pile d'erreurs complète? –
Semble être la même erreur. En fait, il semble pointer vers angulaire-mandrill si je ne suis pas sûr si c'est un résultat de l'angulaire lui-même ne charge pas. Je suis char limité ici, donc je posterai autant que je peux :) - Impossible d'instancier le module WebApp en raison de: Erreur: [$ injector: modulerr] http://errors.angularjs.org/1.5.5/ $ injector/modulerr? p0 = a ...) at Fonction anonyme (http: // localhost: 8000/assets/externe/angular/angular.min.js: 40: 25) à q (http: // localhost : 8000/asse – kierandes