小编RJV*_*RJV的帖子

ng-switch-when-separator不在angularJS中工作

ng-switch我使用时无法正常工作ng-switch-when-separator.当我选择设置时,开关指向默认div

angular.module("myModule", [])
 .controller("myController", function ($scope) {
    $scope.items = ['settings', 'home', 'options', 'other'];
    $scope.opt = $scope.items[0];
  });
Run Code Online (Sandbox Code Playgroud)
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<body ng-app="myModule">
    <div ng-controller="myController">
        <select ng-model="opt" ng-options="item for item in items">
        </select>
        <code>selection={{opt}}</code>
        <hr />
        <div class="animate-switch-container"
            ng-switch on="opt">
            <div class="animate-switch" ng-switch-when="settings|options" ng-switch-when-separator="|">Settings Div</div>
            <div class="animate-switch" ng-switch-when="home">Home Span</div>
            <div class="animate-switch" ng-switch-default>default</div>
        </div>
    </div>
</body>
Run Code Online (Sandbox Code Playgroud)

html angularjs angularjs-directive angularjs-ng-switch

5
推荐指数
1
解决办法
3354
查看次数

在angularjs中使用$ compile

我真的很困惑与angularjs中的$ compile.任何人都可以帮助我,在本文档中使用其他示例的angularjs中的$ compile有什么用处. https://docs.angularjs.org/api/ng/service/$compile

angularjs angularjs-compile

1
推荐指数
1
解决办法
8739
查看次数

Cookie过期日期不起作用C#

我正在创建一个在30天后到期的cookie.

这是c#
e.UserID中的代码- > username,e.rememberMe - > true

FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1,
                                                        "UserID",
                                                        DateTime.Now,
                                                        DateTime.Now.AddDays(30),
                                                        e.rememberMe,
                                                        e.UserID,
                                                        FormsAuthentication.FormsCookiePath);
                // Encrypt the ticket.
                string encTicket = FormsAuthentication.Encrypt(ticket);
                // Create the cookie.
                Response.Cookies.Add(new HttpCookie(FormsAuthentication.FormsCookieName, encTicket));
Run Code Online (Sandbox Code Playgroud)

但是在chrome中,cookie存储到浏览器会话结束 在此输入图像描述

任何的想法

c# asp.net asp.net-mvc

0
推荐指数
1
解决办法
1117
查看次数