0

in ralation to the question Call method in directive controller from other controller.

How can I put more than one independent directives of the same type on the page? Because of its common API (singleton) is the state shared. So if I will place two same directives there both will reflect one instance of API and obviously same state.

Community
  • 1
  • 1
Jakub Truneček
  • 8,800
  • 3
  • 20
  • 35

1 Answers1

2

I think what you're talking about is isolating the scope of a directive, the relevant documentation is here. This may be as simple as scope: true, which makes an isolated scope for the directive which inherits. You can read about that here.

Joe
  • 46,419
  • 33
  • 155
  • 245
  • Yeah, It was (or actually still it is) all about my poor knowledge of the AgnularJS framework. I didn't understand basic concepts of the framework. I have read some materials and core parts of the book "Mastering web application development with AngularJS" (in my opinion excelent book), so my knowledges are getting better now. In this point of view is my question bit irelevant. Anyway, thank you for your response, which is right, at least within of my not well asked question. – Jakub Truneček Mar 25 '14 at 11:53
  • 1
    Cool. It's true, there are some bits about Angular that take a bit of getting used to. – Joe Mar 25 '14 at 11:55