Answer the question
In order to leave comments, you need to log in
How to create $scope in Service?
I have a service that receives a certain string. I have a cached template in $templateCache that I can access from the service.
My goal is to create a new $scope right in the service in order to pass the received text there, compile the template based on it using $compile , and add the result to the end of a certain element on the page.
It is clear that the use of ngRepeat in the controller suggests itself here , but due to some architectural reasons, I need to use the service.
Thought about directives but not googling about how to instantiate a directive in a service (omg).
If anyone has fresh ideas on how to more accurately and competently implement such a task, I will be extremely grateful for your participation!
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