Answer the question
In order to leave comments, you need to log in
Angularjs One controller for different areas of the page. How to transfer data?
There is such layout
<div ng-app>
<div ng-controller="MyCtrl">
<input ng-model="torro" /><div>{{num}}- {{torro}}</div>
</div>
<div ng-controller="MyCtrl">
<div>Ещё раз: {{num}} - {{torro}}</div>
</div>
</div>
function MyCtrl($scope) {
$scope.num = 1560;
}
Ещё раз: {{num}} - {{torro}}
<div ng-app>
<div ng-controller="MyCtrl">
<input ng-model="$parent.torro" />
<div>{{num}}- {{torro}}</div>
</div>
<div ng-controller="MyCtrl">
<div>дубль {{num}} - {{torro}}</div>
</div>
</div>
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