【问题标题】:Convert JQuery tree plugin to Angularjs Directive将 JQuery 树插件转换为 Angularjs 指令
【发布时间】:2014-10-24 09:43:23
【问题描述】:

下面是我在之前项目中使用的JQuery树插件

http://www.abeautifulsite.net/jquery-file-tree/

现在我需要将其转换为 Angularjs 指令。

谁能帮我实现这一点?

【问题讨论】:

  • 就特定问题提出问题。不要让别人为你做你的工作
  • @cathal 我只是在问如何实现这一点如果您知道任何简单的教程链接,请分享它对我很有帮助

标签: jquery angularjs angularjs-directive treeview


【解决方案1】:

终于找到了一个解决方案,而且太简单了

App.directive('filetree', function () {
    return {
        restrict: 'A',
        replace: 'true',
        link: function (scope, element, attrs, ngModelCtrl) {
            $(function () {
                $('#container_id').fileTree({
                        root: '/',
                        script: '/Exm/source/vendors/couple/jqueryFileTree.jsp',
                        expandSpeed: 1,
                        collapseSpeed: 1,
                        multiFolder: false
                }, function(file) {
                        alert(file);
                }); 
            });
        }
    }
});

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-04-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-06-02
    相关资源
    最近更新 更多