小编oko*_*axa的帖子

AngularJS模态窗口指令

我正在尝试为Twitter Bootstrap Modal制作一个指令angularJS指令.

    var demoApp = angular.module('demoApp', []);

demoApp.controller('DialogDemoCtrl', function AutocompleteDemoCtrl($scope) {
    $scope.Langs = [
        {Id:"1", Name:"ActionScript"},
        {Id:"2", Name:"AppleScript"},
        {Id:"3", Name:"Asp"},
        {Id:"4", Name:"BASIC"},
        {Id:"5", Name:"C"},
        {Id:"6", Name:"C++"}
    ];

    $scope.confirm = function (id) {
        console.log(id);
        var item = $scope.Langs.filter(function (item) { return item.Id == id })[0];
        var index = $scope.Langs.indexOf(item);
        $scope.Langs.splice(index, 1);
    };
});

demoApp.directive('modal', function ($compile, $timeout) {
    var modalTemplate = angular.element("<div id='{{modalId}}' class='modal' style='display:none'  tabindex='-1' role='dialog' aria-labelledby='myModalLabel' aria-hidden='true'><div class='modal-header'><h3 id='myModalLabel'>{{modalHeaderText}}</h3></div><div class='modal-body'><p>{{modalBodyText}}</p></div><div class='modal-footer'><a class='{{cancelButtonClass}}' data-dismiss='modal' aria-hidden='true'>{{cancelButtonText}}</a><a ng-click='handler()' class='{{confirmButtonClas}}'>{{confirmButtonText}}</a></div></div>");
    var linkTemplate …
Run Code Online (Sandbox Code Playgroud)

angularjs

8
推荐指数
3
解决办法
3万
查看次数

StackExchange.Redis 中的过期回调

StackExchange.Redis 是否有能力在缓存项过期后执行回调?就像 Microsoft.Practices.EnterpriseLibrary.Caching 中的 ICacheItemRefreshAction

    [Serializable]
    private class CacheEventHandler : ICacheItemRefreshAction
    {
        public void Refresh(string key, object expiredValue, CacheItemRemovedReason removalReason)
        {
            // Item has been removed from cache. Perform desired actions here, based upon
            // the removal reason (e.g. refresh the cache with the item).
            ResetStaticData();
        }
    }
Run Code Online (Sandbox Code Playgroud)

c# callback redis stackexchange.redis

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

标签 统计

angularjs ×1

c# ×1

callback ×1

redis ×1

stackexchange.redis ×1