I am trying to use my company_address.html
template in some places but depending on route,
it's built of a different variable.
The template:
Username: {{ user.company.name }}
Company: {{ user.company.company_name }}
Data is loaded from $http
service.
On offers page, a user is defined by offer.user
, but on my orders page,
its defined by order.user
. I woule like to use the same template for that purpose.
I would also like to mention that there is a user defined in $rootScope
as the application
requires authentication.
I've tried with:
<any ng-include="'path/to/company_address.html'" onload="user=offer.user">
for offers page and similar with onload="user=order.user"
but this does not work. I know that onload modifes the paranet scope, and not the scope created by ng-include directive.
Is it possible to include the same html snippet with some object defined in the ng-include ?