Below code is my directive
1.i am loading  Html based on the requested page so i m not getting how
compile that


corpo.directive('corpInbox', function(companyFactory){
    var directive = {};

    directive.restrict = 'A';

    directive.scope = {
            model : '=mgModel'
    }

    directive.link = function($scope, element, attributes) {

        console.log("preparing the inbox........");

        var content = $('.inbox-content',element);
        var loading = $('.inbox-loading',element);
        var listListing = '';

        var loadInbox = function (el, name) {
            var url = 'templates/inbox/inbox_inbox.html';         //HTML
FILE
            var title = $('.inbox-nav > li.' + name + '
a',element).attr('data-title');
            listListing = name;

            loading.show();
            content.html('');
            toggleButton(el);

            $.ajax({
                type: "GET",
                cache: false,
                url: url,
                dataType: "html",
                success: function(res)
                {
                    toggleButton(el);

                    $('.inbox-nav >
li.active',element).removeClass('active');
                    $('.inbox-nav > li.' + name,element).addClass('active');
                    $('.inbox-header > h1',element).text(title);

                    loading.hide();
                    content.html(res);
                    /*if (Layout.fixContentHeight) {
                        Layout.fixContentHeight();
                    }*/
                    //Metronic.initUniform();
                },
                error: function(xhr, ajaxOptions, thrownError)
                {
                    toggleButton(el);
                }
            });

            // handle group checkbox:
            jQuery('body').on('change', '.mail-group-checkbox', function ()
{
                var set = jQuery('.mail-checkbox',element);
                var checked = jQuery(this).is(":checked");
                jQuery(set).each(function () {
                    $(this).attr("checked", checked);
                });
                //jQuery.uniform.update(set);
            });
        }

       element.on('click', '.inbox-discard-btn', function(e) {
            e.preventDefault();
            loadInbox($(this), listListing);
        });

};
    return directive;
});



On Wed, Apr 29, 2015 at 2:42 PM, Sander Elias <[email protected]> wrote:

> Hi Kiran,
>
> Based on your question, I would say, you need to $compile
> <https://docs.angularjs.org/api/ng/service/$compile> your html before you
> add it to your document.
>
> Regards
> Sander
>
> --
> You received this message because you are subscribed to the Google Groups
> "AngularJS" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/angular.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to