Mon exemple, très basique, application squelette fonctionne très bien. Ensuite, j'ai essayé d'ajouter @MaximShoustin réponse de this question - Plunk here.AngularJs erreur d'injection
Et je reçois
jquery-3.1.1.min.js:2 Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.5.0/$injector/modulerr?p0=inspinia&p1=Error%3A%20%5B%24injector%3Amodulerr%5D%20http%3A%2F%2Ferrors.angularjs.org%2F1.5.0%2F%24injector%2Fmodulerr%3Fp0%3Doc.lazyLoad%26p1%3DError%253A%2520%255B%2524injector%253Anomod%255D%2520http%253A%252F%252Ferrors.angularjs.org%252F1.5.0%252F%2524injector%252Fnomod%253Fp0%253DngSanitize%250A%2520%2520%2520%2520at%2520http%253A%252F%252Flocalhost%252Fa%252Fjs%252Fangular%252Fangular.min.js%253A6%253A416%250A%2520%2520%2520%2520at%2520http%253A%252F%252Flocalhost%252Fa%252Fjs%252Fangular%252Fangular.min.js%253A25%253A136%250A%2520%2520%2520%2520at%2520b%2520(http%253A%252F%252Flocalhost%252Fa%252Fjs%252Fangular%252Fangular.min.js%253A24%253A188)%250A%2520%2520%2520%2520at%2520Object.module%2520(http%253A%252F%252Flocalhost%252Fa%252Fjs%252Fangular%252Fangular.min.js%253A24%253A431)%250A%2520%2520%2520%2520at%2520u%2520(http%253A%252F%252Flocalhost%252Fa%252Fjs%252Fplugins%252Foclazyload%252Fdist%252FocLazyLoad.min.js%253A8%253A2925)%250A%2520%2520%2520%2520at%2520Object.n%2520%255Bas%2520forEach%255D%2520(http%253A%252F%252Flocalhost%252Fa%252Fjs%252Fangular%252Fangular.min.js%253A7%253A355)%250A%2520%2520%2520%2520at%2520u%2520(http%253A%252F%252Flocalhost%252Fa%252Fjs%252Fplugins%252Foclazyload%252Fdist%252FocLazyLoad.min.js%253A8%253A2994)%250A%2520%2520%2520%2520at%2520http%253A%252F%252Flocalhost%252Fa%252Fjs%252Fplugins%252Foclazyload%252Fdist%252FocLazyLoad.min.js%253A8%253A3048%250A%2520%2520%2520%2520at%2520Object.n%2520%255Bas%2520forEach%255D%2520(http%253A%252F%252Flocalhost%252Fa%252Fjs%252Fangular%252Fangular.min.js%253A7%253A355)%250A%2520%2520%2520%2520at%2520u%2520(http%253A%252F%252Flocalhost%252Fa%252Fjs%252Fplugins%252Foclazyload%252Fdist%252FocLazyLoad.min.js%253A8%253A3026)%250A%2520%2520%2520%2520at%2520new%2520%253Canonymous%253E%2520(http%253A%252F%252Flocalhost%252Fa%252Fjs%252Fplugins%252Foclazyload%252Fdist%252FocLazyLoad.min.js%253A8%253A3511)%250A%2520%2520%2520%2520at%2520Object.instantiate%2520(http%253A%252F%252Flocalhost%252Fa%252Fjs%252Fangular%252Fangular.min.js%253A41%253A396)%250A%2520%2520%2520%2520at%2520c%2520(http%253A%252F%252Flocalhost%252Fa%252Fjs%252Fangular%252Fangular.min.js%253A38%253A348)%250A%2520%2520%2520%2520at%2520Object.provider%2520(http%253A%252F%252Flocalhost%252Fa%252Fjs%252Fangular%252Fangular.min.js%253A38%253A290)%250A%2520%2520%2520%2520at%2520d%2520(http%253A%252F%252Flocalhost%252Fa%252Fjs%252Fangular%252Fangular.min.js%253A39%253A234)%250A%2520%2520%2520%2520at%2520http%253A%252F%252Flocalhost%252Fa%252Fjs%252Fangular%252Fangular.min.js%253A39%253A340%250A%2520%2520%2520%2520at%2520n%2520(http%253A%252F%252Flocalhost%252Fa%252Fjs%252Fangular%252Fangular.min.js%253A7%253A355)%250A%2520%2520%2520%2520at%2520g%2520(http%253A%252F%252Flocalhost%252Fa%252Fjs%252Fangular%252Fangular.min.js%253A39%253A135)%250A%2520%2520%2520%2520at%2520http%253A%252F%252Flocalhost%252Fa%252Fjs%252Fangular%252Fangular.min.js%253A39%253A304%250A%2520%2520%2520%2520at%2520n%2520(http%253A%252F%252Flocalhost%252Fa%252Fjs%252Fangular%252Fangular.min.js%253A7%253A355)%250A%2520%2520%2520%2520at%2520g%2520(http%253A%252F%252Flocalhost%252Fa%252Fjs%252Fangular%252Fangular.min.js%253A39%253A135)%250A%2520%2520%2520%2520at%2520fb%2520(http%253A%252F%252Flocalhost%252Fa%252Fjs%252Fangular%252Fangular.min.js%253A43%253A164)%250A%2520%2520%2520%2520at%2520c%2520(http%253A%252F%252Flocalhost%252Fa%252Fjs%252Fangular%252Fangular.min.js%253A20%253A449)%250A%2520%2520%2520%2520at%2520Ac%2520(http%253A%252F%252Flocalhost%252Fa%252Fjs%252Fangular%252Fangular.min.js%253A21%253A259)%250A%2520%2520%2520%2520at%2520fe%2520(http%253A%252F%252Flocalhost%252Fa%252Fjs%252Fangular%252Fangular.min.js%253A20%253A69)%250A%2520%2520%2520%2520at%2520HTMLDocument.%253Canonymous%253E%2520(http%253A%252F%252Flocalhost%252Fa%252Fjs%252Fangular%252Fangular.min.js%253A306%253A372)%250A%2520%2520%2520%2520at%2520j%2520(http%253A%252F%252Flocalhost%252Fa%252Fjs%252Fjquery%252Fjquery-3.1.1.min.js%253A2%253A29948)%250A%2520%2520%2520%2520at%2520k%2520(http%253A%252F%252Flocalhost%252Fa%252Fjs%252Fjquery%252Fjquery-3.1.1.min.js%253A2%253A30262)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%2Fa%2Fjs%2Fangular%2Fangular.min.js%3A6%3A416%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%2Fa%2Fjs%2Fangular%2Fangular.min.js%3A40%3A60%0A%20%20%20%20at%20n%20(http%3A%2F%2Flocalhost%2Fa%2Fjs%2Fangular%2Fangular.min.js%3A7%3A355)%0A%20%20%20%20at%20g%20(http%3A%2F%2Flocalhost%2Fa%2Fjs%2Fangular%2Fangular.min.js%3A39%3A135)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%2Fa%2Fjs%2Fangular%2Fangular.min.js%3A39%3A304%0A%20%20%20%20at%20n%20(http%3A%2F%2Flocalhost%2Fa%2Fjs%2Fangular%2Fangular.min.js%3A7%3A355)%0A%20%20%20%20at%20g%20(http%3A%2F%2Flocalhost%2Fa%2Fjs%2Fangular%2Fangular.min.js%3A39%3A135)%0A%20%20%20%20at%20fb%20(http%3A%2F%2Flocalhost%2Fa%2Fjs%2Fangular%2Fangular.min.js%3A43%3A164)%0A%20%20%20%20at%20c%20(http%3A%2F%2Flocalhost%2Fa%2Fjs%2Fangular%2Fangular.min.js%3A20%3A449)%0A%20%20%20%20at%20Ac%20(http%3A%2F%2Flocalhost%2Fa%2Fjs%2Fangular%2Fangular.min.js%3A21%3A259)%0A%20%20%20%20at%20fe%20(http%3A%2F%2Flocalhost%2Fa%2Fjs%2Fangular%2Fangular.min.js%3A20%3A69)%0A%20%20%20%20at%20HTMLDocument.%3Canonymous%3E%20(http%3A%2F%2Flocalhost%2Fa%2Fjs%2Fangular%2Fangular.min.js%3A306%3A372)%0A%20%20%20%20at%20j%20(http%3A%2F%2Flocalhost%2Fa%2Fjs%2Fjquery%2Fjquery-3.1.1.min.js%3A2%3A29948)%0A%20%20%20%20at%20k%20(http%3A%2F%2Flocalhost%2Fa%2Fjs%2Fjquery%2Fjquery-3.1.1.min.js%3A2%3A30262)
at angular.js:38
at angular.js:4526
at n (angular.js:321)
at g (angular.js:4487)
at fb (angular.js:4409)
at c (angular.js:1691)
at Ac (angular.js:1712)
at fe (angular.js:1606)
at HTMLDocument.<anonymous> (angular.js:30423)
at j (jquery-3.1.1.min.js:2)
at k (jquery-3.1.1.min.js:2)
est ici ce qui devrait être le code approprié pour injecter $sce
et $sanitize
(j'ai ajouté les deux derniers paramètres au contrôleur et la dernière entrée dans le module) - ce que je fais à tort?
function MainCtrl($rootScope, $scope, $http, $interval, $state, $location, $sanitize, $sce)
et
(function() {
angular.module('inspinia', [
'ui.router', // Routing
'oc.lazyLoad', // ocLazyLoad
'ui.bootstrap', // Ui Bootstrap
'ui.grid', // Grid
'ngSanitize'
])
})();
au-delà, le seul changement est d'ajouter
<iframe ng-src="{{cvTrustedUrl}}"></iframe>
dans la vue
[Mise à jour] J'injectais ngSantize, mais maintenant Je reçois
angulaire sanitize.js: 19 Uncaught TypeError: Impossible de lire la propriété '$$ minErr' de non définie à-sanitize.js angulaire: 19 à-sanitize.js angulaire: 6 (anonyme) @-sanitize angulaire. js: 19 (anonyme) @-sanitize.js angulaires: 6
Avez-vous inclus 'angular-sanitize.js' dans votre code html? –
Mais il n'y a pas d'erreur avant d'injecter 'sanitize' et' sce' ...? Si je les supprime, il n'y a pas d'erreur dans la console de développement – Mawg
'$ sanitize' ne fonctionnera qu'après avoir ajouté' angular-sanitize.js' ... avez-vous ajouté cela? –