Ich versuche, eine Richtlinie zu bauen dynamisch den Tracking-Code-Skripte in meiner Haupt-Seite zu importieren:-Tracking-Code-Skript in Richtlinie
<trackingcode trackingcodevalue="{{padCtrl.trackingnumber}}"></trackingcode>
die Richtlinie:
(function() {
'use strict';
angular.module('directives.trackingcode', ['pascalprecht.translate', 'ngSanitize'])
.directive('trackingcode', function() {
return {
restrict: 'E',
//parameter
scope: {
trackingcodevalue: '@' //<-- Here
},
link: function (scope) { },
//template definition
templateUrl: 'directives/trackingcode/trackingcode.html'
}
});
}).call(this);
und die Vorlage:
Die Anweisung wird geladen, aber es gibt einen Fehler und die Statistik wird nicht geladen:
angular.js:12722 ReferenceError: trackingcodevalue is not defined at eval (eval at (jquery.js:328), :3:18) at Function.jQuery.extend.globalEval (jquery.js:328) at jQuery.fn.extend.domManip (jquery.js:5435) at jQuery.fn.extend.append (jquery.js:5218) at . (jquery.js:5333) at jQuery.access (jquery.js:3491) at jQuery.fn.extend.html (jquery.js:5300) at angular.js:8728 at processQueue (angular.js:14991) at angular.js:15007
jede Hilfe ist willkommen.
es funktioniert Danke! – thegio