小编San*_*r_P的帖子

在缓存的.net类中自动检测私有变量的最佳方法?

在缓存的.net类中使用私有变量是一个奇怪且通常很难调试问题的方法.

参见例如:http://code-smart.org.uk/information/beware-asp-net-mvc-actionfilterattributes-are-cached-between-requests/

这可以导致会话混合/交换!通常这些问题归咎于未正确设置输出缓存.

可以(应该?)Resharper检测到这些问题?或者还有另一种方式吗?

c# asp.net resharper caching

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

如何在指令范围内为$ modal设置'inline'控制器?

我正在尝试在指令中打开一个Bootstrap UI $ modal.它可以工作,但是当我想添加一个'内联'控制器(参见下面代码中的注释行)时,我得到一个"[$ injector:unpr]未知提供者:nProvider < - n"错误.

谁能告诉我为什么?

angular.module('myApp.directives').directive('eModalForm', ['$modal', function ($modal) {

   return {
      restrict: 'A',
      link: function ($scope, $element, $attrs) {

         $scope.openModal = function () {
            console.log('//==//');
            var modalInstance = $modal.open({

                templateUrl: '/App/Templates/modal.html',

                // commented these lines to prevent error:
                //controller: function ($scope, $modalInstance) {
                //  $scope.$modalInstance = $modalInstance;
                //},

                size: 'lg'

            });

         };
      }

   };

}]);
Run Code Online (Sandbox Code Playgroud)

我这样调用这个函数:

<div ng-repeat="item in list" ng-click="openModal(item)" e-modal-form>
Run Code Online (Sandbox Code Playgroud)

angularjs angular-ui-bootstrap

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