In the areas/myapp/views/shared/components/CareOpsTopBar/default.cshtml file you have code shown below. Is there any documentation on how this works and what tools, plugins and/or extensions are being used to make this work?
Are the things like {{tenantId}}
coming from the view model used on the page?
<script id="linkedAccountsSubMenuTemplate" type="x-tmpl-mustache">
{{#items}}
<li class="kt-nav__item py-2">
<a href="" data-user-id="{{id}}" data-tenant-id="{{tenantId}}" class="recently-linked-user">
<span class="kt-nav__link-bullet">
<span></span>
</span>
<span class="kt-nav__link-text">
{{shownUserName}}
</span>
</a>
</li>
{{/items}}
</script>
I have a partial view that could use similar code. I'm currently writing all this HTML from a JS script file. I would like to implement the solution shown above, if possible?
2 Answer(s)
-
0
Can someone from support team respond to this question please?
-
0
Hi @exlnt
Sorry, somehow I've missed your question. It is coming from here https://github.com/aspnetzero/aspnet-zero-core/blob/dev/aspnet-core/src/MyCompanyName.AbpZeroTemplate.Web.Mvc/wwwroot/view-resources/Areas/AppAreaName/Views/Layout/_Header.js#L118. Each item in result.items array has a tenantId field and Mustache library renders the html accordingly.