- ngInclude creates a new scope by definition so you can't easily circumvent it. And, since nested scopes inherit from each other your newly created scope will be able to read whatever is in your
SomeController
, so you shouldn't have any problems with new scope. - ngInclude's src attribute will get re-evaluated on each $digest scope, so you can't stop it from calling your controller's method repeatedly. For that matter you need to make sure your method is light and fast and it returns the same output given the same input
- You may avoid initial 404 by returning empty string "" when id is not yet defined:
$scope.getPartial = function(id){
if(!id){
return "";
}
...
}