ITPub博客

首页 > 应用开发 > > mvc和angularjs 写法的疑问 求救 谢谢大侠

mvc和angularjs 写法的疑问 求救 谢谢大侠

作者:R-B 时间:2019-08-27 14:04:56 0 删除 编辑

如图:

<div class="col-sm-1 col-md-1 sidebar" ng-controller="msgCtrl">
    <div class="leftPanel ThemeBGColor3 ">
        <a href="javascript:void"><span class="avatar-face"><span class="avatar-text">@ViewBag.userName</span></span></a>
        <ul class="nav" ng-repeat="x in menuData">
            @if (x.menuId == 1)
            {
                <li><a class="active" href="@Url.Action("x.actionName", "x.controllerName")">x.menuName</a></li>
            }
            else
            {
                <li><a href="@Url.Action("x.actionName", "x.controllerName")">x.menuName</a></li>
            }

        </ul>
    </div>
    <div class="leftmenuContent hide">

    </div>
    <div class="leftmenu_footer">
        <span class="glyphicon glyphicon-plus p" aria-hidden="true"> </span>
    </div>
    <input type="hidden" id="apiUrl" value="@ViewBag.ApiUrl" />
</div>
<script>
    window.longinUrl= '@Url.Action("Index", "Login")';
</script>
<script src="~/Scripts/angular.min.js"></script>

menuData是数据源 从数据库取出的 

数据菜单配置 


因为地址的问题 用了  Url.Action("x.actionName", "x.controllerName") 。请问如何解决这个问题呢 。不用Url.Action地址 前面的变。



来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/4560/viewspace-3162396/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2019-09-03

  • 博文量
    183
  • 访问量
    10150