Answer the question
In order to leave comments, you need to log in
Are variables passed to templates?
I have a simple question at all.
If I have templates connected in index.php (templateUrl: 'part1.html'), then {{user.name}}, which works in index.php, will it work in part1.html?
(Question caused by not working)
Answer the question
In order to leave comments, you need to log in
In angular, in the included template, the scope is isolated from the main scope.
Therefore, you need to add the necessary variables to the scope of the included template.
For example like this:
(scope: {user: '=user'}, templateUrl: 'part1.html')
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question