I want to use the same html for two different routes, but hiding certain elements for one or the other. Is it possible?
For example I have:
share: {
url: '/administration/share_view',
templateUrl: 'administration/copy/share_view.html',
controller: 'DialogDemoCtrl',
name: 'tableShare'
},
publish: {
url: '/administration/publish_view',
templateUrl: 'administration/copy/share_view.html',
controller: 'DialogDemoCtrl',
name: 'tablePublish'
}
and this is the html
<div class="copy-container" ng-controller="DialogDemoCtrl as DialogDemoCtrl">
<div class="container">
<div class="row mt10">
<p class="bold fs16" ng-if="location.path() != '/tablePublish'">Lista de usuarios con acceso a la ficha</p>
<p class="bold fs16">¿A quiénes desea notificar de la publicación?</p>
<table class="table table-striped">
<thead>
<tr>
<th>Seleccionado</th>
<th>Nombre</th>
<th>Email</th>
<th ng-if="location.path() != '/tablePublish'">Ultimo envio</th>
<th ng-if="location.path() != '/tablePublish'">Acciones</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<input type="checkbox" class="ml20">
</td>
<td></td>
<td></td>
<td ng-if="location.path() != '/tablePublish'"></td>
<td ng-if="location.path() != '/tablePublish'">
<a href="#" class="btn btn-pacificblue mr5 p5 p0">Reenviar</a>
<a href="#" class="btn btn-pacificblue mr5 p5 p0">Remover</a>
</td>
</tr>
</tbody>
</table>
</div>
{{location.path()}}
<div class="row text-right">
<a class="btn btn-danger" ng-if="location.path() != '/tablePublish'">Enviar a todos los seleccionados</a>
<a class="btn btn-danger">Publicar y notificar a los seleccionados</a>
</div>
</div>
The items are hidden, but they are not displayed in the route that I want them to appear.