带有ng-include的指令中的jQuery组件

时间:2015-05-01 12:10:49

标签: javascript jquery angularjs angularjs-directive angularjs-ng-include

我在角度中使用了一个带有这样的指令的jQuery组件:

angular.module('directives.flavr', [])

    .directive('flavr', function () {
        return {
            restrict: 'E',
            scope: true,
            link: function (scope, element, attrs) {
                element.bind('click', function () {
                    new $.flavr({
                        title: 'Form',
                        content: 'HTML form example',
                        dialog: 'form',
                        form: {content: '<div ng-include="directives/flavr/templates/loginForm.tpl.html"></div>', method: 'post'},
                        onSubmit: function ($container, $form) {
                            alert($form.serialize());
                            return false;
                        }
                    });
                });
            }
        };
    });

flavr弹出窗口接受HTML来构建模态窗口,是否可以使用$ templateCache html文件存储此html?

如果不可能,那么将随机HTML内容“传递”到我的指令以呈现我喜欢的内容的最佳方式是什么?

理想情况下,我想做这样的事情:

<flavr html="/* I want to put a templatecache url and be able to load it when the popup is open */"></flavr>

有什么想法吗?

0 个答案:

没有答案