Get access to $ scope from $ rootscope angularjs

I would like to know if there is a way to access $ scopes variables using $ rootScope in such a way that if a function is defined in scope, I can call it using $ rootscope or if there is a variable defined using $ scope.var1 I could access it using $ rootScope for

+4
source share
1 answer

Each area has two property references to its child areas, namely: $$childHeadand $$childTail. In addition, each scope object has $$nextSiblingand properties $$prevSiblingthat point to instance instances of a scope with the same level. With these properties, you can move all child regions horizontally or vertically. Depending on why you need to do this at every step, you should check for the presence of the required property or method.

At the same time, I do not see a real business logic application for such a traversal of a child, except for logging / debugging tasks, for example, to create a tree of area hierarchies, etc.

+4
source

Source: https://habr.com/ru/post/1606617/


All Articles