I'm using a special theme in my application that has a chat feature. To open this chat the template uses the following href="#offchat-canvas"
reference for an element of my view. This chat is an offcanvas that has the message history. However this call is made with static elements in the example. When I tried to insert dynamic elements using ng-repeat
href just changes my url url/s#/offcanvas-chat
. Href with static values opens a offcanvas side without changing the URL.
I have already tried the sanitize to insert the html.
I have tried target methods ( data-target="_self"
).
I've already tried using ng-href="{{elementId}}"
with $scope.elementId = '#offcanvas'
I've tried to change to HTML5 mode.
I wonder if I'm forgetting something important. I'm new to angularJS and WEB applications. If you need more details, I can respond.
Edited
Static code:
<li class="tile divider-full-bleed">
<div class="tile-content">
<div class="tile-text"><strong>Estático</strong></div>
</div>
</li>
<li class="tile">
<a class="tile-content ink-reaction" ng-click="createChat(users[3])" href="#offcanvas-chat" data-toggle="offcanvas" data-backdrop="false">
<div class="tile-icon">
<img src="http://acdc.sandro.in/{{users[3].avatar}}"alt="" />
</div>
<div class="tile-text">
Teste Chat Dinâmico {{users[3].nome}}
<small>123-123-3210</small>
</div>
</a>
</li>
Dynamic Code:
<li class="tile divider-full-bleed">
<div class="tile-content">
<div class="tile-text"><strong>(NG) {{letter}}</strong></div>
</div>
</li>
<li class="tile" ng-repeat="user in getUsersByLetter(letter)">
<a class="tile-content ink-reaction" ng-click="createChat(user)" href="#offcanvas-chat" data-toggle="offcanvas" data-backdrop="false" >
<div class="tile-icon">
<img src="http://acdc.sandro.in/{{user.avatar}}"alt="" />
</div>
<div class="tile-text">
(NG) Teste Chat Dinâmico {{user.nome}}
<small>123-123-3210</small>
</div>
</a>
</li>