Because there are many repeated $scope.getName method declarations in the controllers of each router in the project, I would like to put these common parts in the controller outside the router as described below.
<p ng-controller="parentController">
<p ui-view></p>
</p>
Suppose there is a method called $scope.getName in the parentController;
And there is a childController configured in the route. At this time, if $scope.getName(person.name) is run directly in the childController, will it affect the page performance?
淡淡烟草味2017-05-15 17:14:51
There is a way to provide services in angular to achieve shared methods and reuse
I have never practiced on performance issues, so I dare not speak nonsense.
I feel like writing code like this is not easy to maintain