ich habe ein Problem mit der Richtlinie den Zugriff von einem anderen und Code unterWie kann auf die Direktive von anderen in angularjs zugegriffen werden?
app.module('myApp', [])
.directive('vikiQues', ['$http', '$compile', function($http, $compile){
return {
restrict : 'E',
scope : true,
controller : [
function(){
}
],
link : function(scope, iElement, iAttrs){
$http.get('getOutside/1')
.then(function(data){
iElement.html($compile($(data.data))(scope));
/*scope.addThere.find('div.please-wait').remove();
scope.questionList.push({
text : '',
options : []
});*/
});
}
};
}]).directive('vikiOption', ['$http', '$compile', function ($http, $compile) {
return {
restrict: 'E',
scope : true,
require : '^vikiQues',
link: function (scope, iElement, iAttrs, vikiQuesCtrl) {
$http.get('getInside/1')
.then(function(data){
var _ = $(data.data);
scope._opt = false;
iElement.html($compile(_)(scope));
if (scope.$parent.questionList[scope.$parent.totalQuestionCount-1].options.length > 2)
_opt = true;
scope.now = {
id : scope.$parent.questionList[scope.$parent.totalQuestionCount-1].options.length,
char : '',
text : '',
image : '',
removeable : scope._opt,
};
ques.now.options.push(scope.now);
});
}
};
}]);
Ich habe diesen Fehler jedes Mal: angular.min.js: 117 Fehler: [$ Kompilierung: ctreq] http://errors.angularjs.org/1.5.7/ $ kompilieren/ctreq p0 = vikiQues & p1 = vikiOption
, was da drin ist falsch?
HTML-Code:
0" >
viki-ques und viki-option sind Vorlagen, die von php kommen. wenn ich entferne iElement.html ($ compile ($ (data.data)) (Bereich)); code, ich kann keinen fehler bekommen. Ich denke, dass ich dort Fehler habe. ithink $ compile oder scope liefern diesen Fehler.(Hilfe)
Post HTML erhalten. – dfsq
Nicht genügend Informationen, um zu helfen. Erstellen Sie eine Demo mit dem Problem, dann ist es einfach, das Problem herauszufinden. – dfsq