6
I am using a special Theme in my application that has a chat feature. To open this chat the template uses the following reference href="#offchat-canvas"
to an element in my view. This chat is a 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 the ng-repeat
href just changes my url url/s#/offcanvas-chat
. href with static values opens a offcanvas side without changing the URL.
I’ve tried Sanitize to insert html.
I’ve tried target methods (data-target="_self"
).
I’ve tried using the ng-href="{{elementId}}"
with $scope.elementId = '#offcanvas'
I’ve tried switching to HTML5 mode.
I would like to know if I am forgetting something important. I am new to Angularjs and WEB applications. If you need more details, I can answer.
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>
Could you post the HTML code of your Repeater? I think it’s easier to help. It’s usually Sanitize that does that. But it may also be missing using the
ng-href
– rodrigogq
I edited my question. Both Sanitize and ng-href did not work.
– Pedro Mota