M
M
Max2017-06-23 20:44:34
Angular
Max, 2017-06-23 20:44:34

Why is $scope not being passed?

<body ng-controller="x">
    <div ng-view></div>

$scope.y is set in x controller. How can I get this $scope.y inside ng-view?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
ozknemoy, 2017-06-24
@maxIvanenqo

I didn’t use a regular router, but I think / I’m sure that ng-view creates an isolated scope and simple inheritance does not work here. in general it is necessary to reconsider the existing architecture. or use not $scope but $rootScope which is also a bad decision

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question