Answer the question
In order to leave comments, you need to log in
How to dynamically add a directive on Amgular?
When I click in the right place, the page should load
// пытался так
$scope.click = function(typeModel){
angular.element(document.querySelector(".loadEditor")).html(
'<editor-content ng-show="visibleEditor.visible"></editor-content>'
);
}
// пытался так
$scope.click = function(typeModel){
angular.element(document.querySelector(".loadEditor")).html(
$compile( '<editor-content ng-show="visibleEditor.visible"></editor-content>')($scope)
);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question