相关疑难解决方法(0)

AngularJS - 绑定到指令resize

如何在调整指令大小时通知我?我试过了

element[0].onresize = function() {
            console.log(element[0].offsetWidth + " " + element[0].offsetHeight);
        }
Run Code Online (Sandbox Code Playgroud)

但它没有调用这个功能

(function() {
'use strict';

// Define the directive on the module.
// Inject the dependencies. 
// Point to the directive definition function.
angular.module('app').directive('nvLayout', ['$window', '$compile', layoutDirective]);

function layoutDirective($window, $compile) {
    // Usage:
    // 
    // Creates:
    // 
    var directive = {
        link: link,
        restrict: 'EA',
        scope: {
            layoutEntries: "=",
            selected: "&onSelected"
        },
        template: "<div></div>",
        controller: controller
    };
    return directive;

    function link(scope, element, attrs) {
        var elementCol = []; …
Run Code Online (Sandbox Code Playgroud)

angularjs angularjs-directive

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

标签 统计

angularjs ×1

angularjs-directive ×1