AngularJS可调整大小的指令

时间:2014-05-01 19:42:39

标签: javascript jquery angularjs

我在angularjs中有一个指令,处理将jqueryui.resizeable()添加到dom元素。它正常工作,直到我们通过一些其他控制器并将它们设置为与IE8兼容。 (例如,我们摆脱了吸气剂)。

现在,当我尝试运行我的应用程序(之前正在运行)。我收到错误消息:

TypeError:undefined不是postLink的函数

以下是我的指令的代码。关于为什么现在发生这种情况的任何想法?

HTML:

<div resizable id="container"></div>

指令:

angular.module('tffullscreen.directives').
    directive('resizable', function() {
        return {
            restrict: 'A',
            scope: {
                callback: '&onResize'
            },
            link: function postLink(scope, elem, attrs) {
            elem.resizable({
                helper: 'resizeHelper',
                aspectRatio: true});
            elem.on('resizestop', function (evt, ui) {
                if (scope.callback) { scope.callback(); }
            });
            window.e = elem;
        }
    };
});

0 个答案:

没有答案